Including Files and Deeply Directories in Rustby@josejaviasilis
11,996 reads

Including Files and Deeply Directories in Rust

tldt arrow
EN
Read on Terminal Reader🖨️

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

Learn More
LEARN MORE ABOUT @JOSEJAVIASILIS'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa