Focus mode

Rust Fundamentals

Crates and Modules:Crates Structure

While creating comprehensive programs, it is very important to design code blocks with maximum efficiency and quality. This is mostly possible by grouping related functions and separating the code with different features.

Per Rust official documentation Rust has a number of features that allow you to manage your code’s organization, including which details are exposed, which details are private, and what names are in each scope in your programs. These features, sometimes collectively referred to as the module system, include:

  • Packages: A Cargo feature that lets you build, test, and share crates
  • Crates: A tree of modules that produces a library or executable
  • Modules and use: Let you control the organization, scope, and privacy of paths
  • Paths: A way of naming an item, such as a struct, function, or module

Generally, there are two ways to develop these features: Using existing libraries/features and developing your own code from scratch.

You can find detailed further information from Rust Official documentation: https://doc.rust-lang.org/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html

left-disk

Programs to Accelerate Your Progress in a Software Career

Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!

right-cube

Comments

You need to enroll in the course to be able to comment!