Module prelude
Source pub use super::option::Option::None;
pub use super::option::Option::Some;
pub use super::result::Result::Err;
pub use super::result::Result::Ok;
pub use super::collections::*;
- borrow
- A module for working with borrowed data.
- fmt
- Utilities for formatting and printing
String
s. - mem
- Basic functions for dealing with memory.
- vec
- A contiguous growable array type with heap-allocated contents, written
Vec<T>
.
- format
- Creates a
String
using interpolation of runtime expressions. - vec
- Creates a
Vec
containing the arguments.
- Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically
Reference Counted’.
- 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.
- 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’. - SyncUnsafeCellExperimental
UnsafeCell
, but Sync
.
- 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
).
- 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 that allows explicit creation of a duplicate value.
- 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.
- drop
- Disposes of a value.
- 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.