Focus mode

Rust Fundamentals

Crates and Modules:Workspaces

There are two basic types of projects in Rust. Libraries and binary (like executables.exe)

Libraries are self-contained blocks of code intended for use by other applications. The purpose of a library is to benefit other developers in repetitive processes and speed up the development process. For a library project type, the program's starting point is the src/lib.rs file.

In Rust the project structure like that:

  • Workspace: 1-n packages
  • Package: 0-1 library and/or 0-n binary, but at least 1 crate
  • Crate: 0-n modules
  • Module: 1-n source files
  • Source File: 0-n functions

The simplest project we have created with Cargo means 1 crate on its own.

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!