Knowledge Garden

Search

Search IconIcon to open search

Libraries and Modules in Rust

Last updated Dec 1, 2022 Edit Source

# Libraries and modules

the main library is lib.rs inside that if you declare a module via pub mod mymodule; (ended in semicolon) then rust will look for rs file in the same directory as the name of the module. Nested modules use directories

create executable binary for the library place file in bin/ of src/ like bar.rs or something