paint-brush
Including Files and Deeply Directories in Rustby@josejaviasilis
23,953 reads
23,953 reads

Including Files and Deeply Directories in Rust

by Jose Javi Asilis6mMarch 26th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow
EN

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
Jose Javi Asilis

Jose Javi Asilis

@josejaviasilis

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

Learn More
LEARN MORE ABOUT @JOSEJAVIASILIS'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Jose Javi Asilis HackerNoon profile picture
Jose Javi Asilis@josejaviasilis
Empowering first time tech startup founders with insights to time-consuming tech challenges

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite