in - Rust (original) (raw)

Expand description

Iterate over a series of values with for.

The expression immediately following in must implement the IntoIterator trait.

§Literal Examples:

(Read more about range patterns)

The other use of in is with the keyword pub. It allows users to declare an item as visible only within a given scope.

§Literal Example:

Starting with the 2018 edition, paths for pub(in path) must start with crate, self orsuper. The 2015 edition may also use paths starting with :: or modules from the crate root.

For more information, see the Reference.