From Rust Community Wiki

A prelude is a module that is intended for importing all items in it, using a glob import (*). For example:

use std::io::prelude::*;

This makes all items in the prelude available.

The Rust prelude[edit]

The standard library has a special prelude, which is imported automatically in every Rust file. It is located in std::preludeThis links to official Rust documentation and contains the following items:

In #![no_std] crates, the core prelude is used instead, which is a subset of the prelude in std. There is also an experimental alloc prelude to complement the core prelude. This one is not imported automatically, however.

Note that primitive types are always in scope, so they don't need to be imported.

Other preludes[edit]

Any crate can define a prelude. However, these preludes must be imported manually. For example, the standard library contains the following preludes, besides the ones already mentioned: