Module prelude

Source

Modules§

fmt
Utilities for formatting and printing Strings.

Macros§

btreemap
btreeset
format
Creates a String using interpolation of runtime expressions.
hashmap
hashset
indexmap
indexset
vec
Creates a Vec containing the arguments.

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
BTreeMap
An ordered map based on a B-Tree.
BTreeSet
An ordered set based on a B-Tree.
BorrowError
An error returned by RefCell::try_borrow.
BorrowMutError
An error returned by RefCell::try_borrow_mut.
Box
A pointer type that uniquely owns a heap allocation of type T.
Cell
A mutable memory location.
LazyCell
A value which is initialized on the first access.
LinkedList
A doubly-linked list with owned nodes.
NonIterMap
A thin wrapper around a HashMap, which guarantees that a HashMap usage will not result in a non-deterministic execution (simply by disallowing the iteration over its elements).
OnceCell
A cell which can nominally be written to only once.
PhantomData
Zero-sized type used to mark things that “act like” they own a T.
Rc
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
Ref
Wraps a borrowed reference to a value in a RefCell box. A wrapper type for an immutably borrowed value from a RefCell<T>.
RefCell
A mutable memory location with dynamically checked borrow rules
RefMut
A wrapper type for a mutably borrowed value from a RefCell<T>.
String
A UTF-8–encoded, growable string.
UnsafeCell
The core primitive for interior mutability in Rust.
Vec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.
VecDeque
A double-ended queue implemented with a growable ring buffer.
SyncUnsafeCellExperimental
UnsafeCell, but Sync.

Enums§

Cow
A clone-on-write smart pointer.
Option
The Option type. See the module level documentation for more.
Result
Result is a type that represents either success (Ok) or failure (Err).

Traits§

AsMut
Used to do a cheap mutable-to-mutable reference conversion.
AsRef
Used to do a cheap reference-to-reference conversion.
Clone
A common trait for the ability to explicitly duplicate an object.
Copy
Types whose values can be duplicated simply by copying bits.
Debug
? formatting.
Default
A trait for giving a type a useful default value.
Display
Format trait for an empty format, {}.
DoubleEndedIterator
An iterator able to yield elements from both ends.
Drop
Custom code within the destructor.
Eq
Trait for comparisons corresponding to equivalence relations.
ExactSizeIterator
An iterator that knows its exact length.
Extend
Extend a collection with the contents of an iterator.
Fn
The version of the call operator that takes an immutable receiver.
FnMut
The version of the call operator that takes a mutable receiver.
FnOnce
The version of the call operator that takes a by-value receiver.
From
Used to do value-to-value conversions while consuming the input value. It is the reciprocal of Into.
FromIterator
Conversion from an Iterator.
FromStr
Parse a value from a string
Into
A value-to-value conversion that consumes the input value. The opposite of From.
IntoIterator
Conversion into an Iterator.
Iterator
A trait for dealing with iterators.
Ord
Trait for types that form a total order.
PartialEq
Trait for comparisons using the equality operator.
PartialOrd
Trait for types that form a partial order.
Send
Types that can be transferred across thread boundaries.
Sized
Types with a constant size known at compile time.
Sync
Types for which it is safe to share references between threads.
ToOwned
A generalization of Clone to borrowed data.
ToString
A trait for converting a value to a String.
TryFrom
Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of TryInto.
TryInto
An attempted conversion that consumes self, which may or may not be expensive.
Unpin
Types that do not require any pinning guarantees.

Functions§

drop
Disposes of a value.
hash_map_new
Creates an empty map with capacity 0 and default Hasher
hash_map_with_capacity
Creates an empty map with given capacity and default Hasher
hash_set_new
Creates an empty set with capacity 0 and default Hasher
hash_set_with_capacity
Creates an empty set with given capacity and default Hasher
index_map_new
This is safe for std and no-std use cases (unlike IndexMap::new which disappears when std is not in the toolchain - see this article for deep technical reasons)
index_map_with_capacity
This is safe for std and no-std use cases (unlike IndexMap::with_capacity which disappears when std is not in the toolchain - see this article for deep technical reasons)
index_set_new
This is safe for std and no-std use cases (unlike IndexSet::new which disappears when std is not in the toolchain - see this article for deep technical reasons)
index_set_with_capacity
This is safe for std and no-std use cases (unlike IndexSet::with_capacity which disappears when std is not in the toolchain - see this article for deep technical reasons)

Type Aliases§

HashMap
HashSet
IndexMap
IndexSet

Derive Macros§

Clone
Derive macro generating an impl of the trait Clone.
Copy
Derive macro generating an impl of the trait Copy.
Debug
Derive macro generating an impl of the trait Debug.
Default
Derive macro generating an impl of the trait Default.
Eq
Derive macro generating an impl of the trait Eq.
Ord
Derive macro generating an impl of the trait Ord. The behavior of this macro is described in detail here.
PartialEq
Derive macro generating an impl of the trait PartialEq. The behavior of this macro is described in detail here.
PartialOrd
Derive macro generating an impl of the trait PartialOrd. The behavior of this macro is described in detail here.