Cargo.toml path [lib] cannot specify a folder?

Here is my Cargo.toml profile

name = "rustlibrary"
version = "0.2.0"
authors = [
    "James Zow <>"
license = "Apache-2.0"
repository = ""
#documentation = ""
readme = ""
description = "Integrate all rust related projects and books for easy reading"
edition = "2021"

members = [
    # other module
    # basics workspace
    # complex workspace
    # example workspace
    # web workspace

name = "rustlibrary"
path = "basics/crates"
bench = false

error message:

➜  rustlibrary git:(dev) ✗ cargo build
   Compiling rustlibrary v0.2.0 (/Users/jameszow/Documents/RustWorkSpace/rustlibrary)
error: couldn't read basics/crates: Is a directory (os error 21)

error: could not compile `rustlibrary` due to previous error

He can only specify I want to build these sub modules

It's not clear what this would mean, a Rust crate is, in an API sense, a wrapper for a Rust module, and a directory isn't a module.

What does someone importing this lib see?

You might just want:

// ./Cargo.toml
basics_crates.path = "basics/crates"
// ./src/
pub use basics_crates::*;

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.