Expand description
Prelude exporting types from the Rust standard library (std
)
Modules§
- alloc_
crate - The Rust core allocation and collections library
- core
- The Rust Core Library
- slice
- std
- The Rust Standard Library
Macros§
- assert
- Asserts that a boolean expression is
true
at runtime. - assert_
eq - Asserts that two expressions are equal to each other (using
PartialEq
). - assert_
ne - Asserts that two expressions are not equal to each other (using
PartialEq
). - cfg
- Evaluates boolean combinations of configuration flags at compile-time.
- column
- Expands to the column number at which it was invoked.
- compile_
error - Causes compilation to fail with the given error message when encountered.
- concat
- Concatenates literals into a static string slice.
- dbg
- Prints and returns the value of a given expression for quick and dirty debugging.
- debug_
assert - Asserts that a boolean expression is
true
at runtime. - debug_
assert_ eq - Asserts that two expressions are equal to each other.
- debug_
assert_ ne - Asserts that two expressions are not equal to each other.
- env
- Inspects an environment variable at compile time.
- eprint
- Prints to the standard error.
- eprintln
- Prints to the standard error, with a newline.
- file
- Expands to the file name in which it was invoked.
- format
- Creates a
String
using interpolation of runtime expressions. - format_
args - Constructs parameters for the other string-formatting macros.
- line
- Expands to the line number on which it was invoked.
- panic
- Panics the current thread.
- Prints to the standard output.
- println
- Prints to the standard output, with a newline.
- stringify
- Stringifies its arguments.
- thread_
local - Declare a new thread local storage key of type
std::thread::LocalKey
. - todo
- Indicates unfinished code.
- unreachable
- Indicates unreachable code.
- vec
Non- no_global_oom_handling
- Creates a
Vec
containing the arguments.
Structs§
- Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- ArcWeak
Weak
is a version ofArc
that holds a non-owning reference to the managed allocation.- Atomic
Bool target_has_atomic_load_store="8"
- A boolean type which can be safely shared between threads.
- Atomic
I8 - An integer type which can be safely shared between threads.
- Atomic
I16 - An integer type which can be safely shared between threads.
- Atomic
I32 - An integer type which can be safely shared between threads.
- Atomic
I64 - An integer type which can be safely shared between threads.
- Atomic
Isize - An integer type which can be safely shared between threads.
- Atomic
Ptr target_has_atomic_load_store="ptr"
- A raw pointer type which can be safely shared between threads.
- Atomic
U8 - An integer type which can be safely shared between threads.
- Atomic
U16 - An integer type which can be safely shared between threads.
- Atomic
U32 - An integer type which can be safely shared between threads.
- Atomic
U64 - An integer type which can be safely shared between threads.
- Atomic
Usize - An integer type which can be safely shared between threads.
- Box
- A pointer type that uniquely owns a heap allocation of type
T
. - File
- An object providing access to an open file on the filesystem.
- Manually
Drop - A wrapper to inhibit the compiler from automatically calling
T
’s destructor. This wrapper is 0-cost. - NonZero
- A value that is known not to equal zero.
- Path
- A slice of a path (akin to
str
). - PathBuf
- An owned, mutable path (akin to
String
). - Phantom
Data - Zero-sized type used to mark things that “act like” they own a
T
. - Phantom
Pinned - A marker type which does not implement
Unpin
. - Rc
- A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
- RcWeak
Weak
is a version ofRc
that holds a non-owning reference to the managed allocation.- Saturating
- Provides intentionally-saturating arithmetic on
T
. - String
- A UTF-8–encoded, growable string.
- TypeId
- A
TypeId
represents a globally unique identifier for a type. - Unsafe
Cell - The core primitive for interior mutability in Rust.
- Vec
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’. - Wrapping
- Provides intentionally-wrapped arithmetic on
T
.
Enums§
- Cow
- A clone-on-write smart pointer.
- Infallible
- The error type for errors that can never happen.
- 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§
- Any
- A trait to emulate dynamic typing.
- AsMut
- Used to do a cheap mutable-to-mutable reference conversion.
- AsRef
- Used to do a cheap reference-to-reference conversion.
- Borrow
- A trait for borrowing data.
- Borrow
Mut - A trait for mutably borrowing data.
- 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.
- Deref
- Used for immutable dereferencing operations, like
*v
. - Deref
Mut - Used for mutable dereferencing operations, like in
*v = 1;
. - Display
- Format trait for an empty format,
{}
. - Double
Ended Iterator - An iterator able to yield elements from both ends.
- Drop
- Custom code within the destructor.
- Eq
- Trait for comparisons corresponding to equivalence relations.
- Exact
Size Iterator - 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
. - From
Iterator - Conversion from an
Iterator
. - Future
- A future represents an asynchronous computation obtained by use of
async
. - Hash
- A hashable type.
- Hasher
- A trait for hashing an arbitrary stream of bytes.
- Into
- A value-to-value conversion that consumes the input value. The
opposite of
From
. - Into
Future - Conversion into a
Future
. - Into
Iterator - Conversion into an
Iterator
. - Iterator
- A trait for dealing with iterators.
- Ord
- Trait for types that form a total order.
- Partial
Eq - Trait for comparisons using the equality operator.
- Partial
Ord - Trait for types that form a partial order.
- RefUnwind
Safe - A marker trait representing types where a shared reference is considered unwind safe.
- 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.
- Unwind
Safe - A marker trait which represents “panic safe” types in Rust.
Functions§
- align_
of - Returns the ABI-required minimum alignment of a type in bytes.
- align_
of_ val - Returns the ABI-required minimum alignment of the type of the value that
val
points to in bytes. - alloc⚠
- Allocates memory with the global allocator.
- alloc_
zeroed ⚠ - Allocates zero-initialized memory with the global allocator.
- compiler_
fence - A “compiler-only” atomic fence.
- dealloc⚠
- Deallocates memory with the global allocator.
- drop
- Disposes of a value.
- fence
- An atomic fence.
- forget
- Takes ownership and “forgets” about the value without running its destructor.
- identity
- The identity function.
- needs_
drop - Returns
true
if dropping values of typeT
matters. - realloc⚠
- Reallocates memory with the global allocator.
- replace
- Moves
src
into the referenceddest
, returning the previousdest
value. - size_of
- Returns the size of a type in bytes.
- size_
of_ val - Returns the size of the pointed-to value in bytes.
- swap
- Swaps the values at two mutable locations, without deinitializing either one.
- take
- Replaces
dest
with the default value ofT
, returning the previousdest
value. - transmute⚠
Deprecated - Reinterprets the bits of a value of one type as another type.
- transmute_
copy ⚠ - Interprets
src
as having type&Dst
, and then readssrc
without moving the contained value. - type_
name - Returns the name of a type as a string slice.
- type_
name_ of_ val - Returns the type name of the pointed-to value as a string slice.
- zeroed⚠
- Returns the value of type
T
represented by the all-zero byte-pattern.
Unions§
- Maybe
Uninit - A wrapper type to construct uninitialized instances of
T
.
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
. - Hash
- Derive macro generating an impl of the trait
Hash
. - Ord
- Derive macro generating an impl of the trait
Ord
. The behavior of this macro is described in detail here. - Partial
Eq - Derive macro generating an impl of the trait
PartialEq
. The behavior of this macro is described in detail here. - Partial
Ord - Derive macro generating an impl of the trait
PartialOrd
. The behavior of this macro is described in detail here.