Including Files and Deeply Directories in Rustby@josejaviasilis
21,218 reads

Including Files and Deeply Directories in Rust

tldt arrow
EN
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Rust doesn't see files as files, but it sees them as modules and files inside folders as sub-modules. You can't just reference them directly with a simple import or drilled namespacing a la JavaScript or C# and use them right away. When using crate, you use the root directory to include everything. Rust can help Rust's compiler to identify it by providing a #path directive to use in our welcome code. Then we can reference it directly to call the run function directly.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Including Files and Deeply Directories in Rust
Jose Javi Asilis HackerNoon profile picture

@josejaviasilis

Jose Javi Asilis

Empowering first time tech startup founders with insights to time-consuming tech challenges


Receive Stories from @josejaviasilis

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!