Standard Library Types

Standard Library, Primitives and Preludes

⭐️ In Rust, language elements are implemented by not only std library crate but also compiler as well. Examples,

  • Primitives: Defined by the compiler and methods are implemented by std library directly on primitives.
  • Standard Macros: Defined by both compiler and std

The std library has been divided into modules, according to the main areas each covered.

⭐️ While primitives are implemented by the compiler, the standard library implements the most useful methods directly on the primitive types. But some rarely useful language elements of some primitives are stored on relevant std modules. This is why you can see char, str and integer types on both primitives and std modules.