An error which can be returned when parsing an IP address or a socket address.
An iterator over
Path
and its ancestors.
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically
Reference Counted’.
A simple wrapper around a type to assert that it is unwind safe.
An ordered map based on a
B-Tree.
An ordered set based on a B-Tree.
A barrier enables multiple threads to synchronize the beginning
of some computation.
A priority queue implemented with a binary heap.
A pointer type that uniquely owns a heap allocation of type T
.
An iterator over the bytes of a string slice.
A mutable memory location.
An iterator that links two iterators together, in a chain.
An iterator over the
char
s of a string slice, and their positions.
The error type returned when a conversion from
u32
to
char
fails.
An iterator over the
char
s of a string slice.
An iterator over slice in (non-overlapping) chunks separated by a predicate.
An iterator over slice in (non-overlapping) mutable chunks separated
by a predicate.
An iterator over a slice in (non-overlapping) chunks (chunk_size
elements at a
time), starting at the beginning of the slice.
An iterator over a slice in (non-overlapping) chunks (chunk_size
elements at a
time), starting at the beginning of the slice.
An iterator over a slice in (non-overlapping) mutable chunks (chunk_size
elements at a time), starting at the beginning of the slice.
An iterator over a slice in (non-overlapping) mutable chunks (chunk_size
elements at a time), starting at the beginning of the slice.
An iterator that clones the elements of an underlying iterator.
A Condition Variable
An iterator that copies the elements of an underlying iterator.
An iterator that repeats endlessly.
An iterator that decodes UTF-16 encoded code points from an iterator of u16
s.
An error that can be returned when decoding UTF-16 code points.
Opaque type representing the discriminant of an enum.
Helper struct for safely printing paths with
format!
and
{}
.
An iterator that yields nothing.
An iterator of
u16
over the string encoded as UTF-16.
An iterator that yields the current count and the element during iteration.
An iterator over the escaped version of a byte slice.
An iterator that filters the elements of iter
with predicate
.
An iterator that uses f
to both filter and map elements from iter
.
An iterator that maps each element to an iterator, and yields the elements
of the produced iterators.
An iterator that flattens one level of nesting in an iterator of things
that can be turned into iterators.
An iterator where each iteration calls the provided closure F: FnMut() -> Option<T>
.
A possible error value when converting a String
from a UTF-8 byte vector.
A possible error value when converting a String
from a UTF-16 byte slice.
An iterator that yields None
forever after the underlying iterator
yields None
once.
A
hash map implemented with quadratic probing and SIMD lookup.
A
hash set implemented as a
HashMap
where the value is
()
.
An iterator that calls a function with a reference to each element before
yielding it.
An IPv4 address.
An IPv6 address.
An owned permission to join on a thread (block on its termination).
A value which is initialized on the first access.
A value which is initialized on the first access.
An iterator over the lines of a string, as string slices.
A doubly-linked list with owned nodes.
A struct containing information about the location of a panic.
A wrapper to inhibit the compiler from automatically calling T
’s
destructor. This wrapper is 0-cost.
An iterator that maps the values of iter
with f
.
An iterator that only accepts elements while predicate
returns Some(_)
.
A mutual exclusion primitive useful for protecting shared data
An RAII implementation of a “scoped lock” of a mutex. When this structure is
dropped (falls out of scope), the lock will be unlocked.
A value that is known not to equal zero.
A cell which can nominally be written to only once.
A synchronization primitive which can nominally be written to only once.
An iterator that yields a single element of type A
by
applying the provided closure F: FnOnce() -> A
.
Output struct
OutputBuilder struct
OutputList struct
OutputListBuilder struct
A struct providing information about a panic.
An error returned when parsing a
bool
using
from_str
fails
An error which can be returned when parsing a char.
An error which can be returned when parsing a float.
An error which can be returned when parsing an integer.
A slice of a path (akin to
str
).
An owned, mutable path (akin to
String
).
An iterator with a peek()
that returns an optional reference to the next
element.
A pointer which pins its pointee in place.
A type of error which can be returned whenever a lock is acquired.
A structure wrapping a Windows path prefix as well as its unparsed string
representation.
An iterator over a slice in (non-overlapping) chunks (chunk_size
elements at a
time), starting at the end of the slice.
An iterator over a slice in (non-overlapping) chunks (chunk_size
elements at a
time), starting at the end of the slice.
An iterator over a slice in (non-overlapping) mutable chunks (chunk_size
elements at a time), starting at the end of the slice.
An iterator over a slice in (non-overlapping) mutable chunks (chunk_size
elements at a time), starting at the end of the slice.
An iterator over the subslices of the vector which are separated
by elements that match pred
, starting from the end of the slice.
An iterator over subslices separated by elements that match a
predicate function, limited to a given number of splits, starting
from the end of the slice.
A (half-open) range bounded inclusively below and exclusively above
(start..end
).
A range only bounded inclusively below (start..
).
An unbounded range (..
).
A range bounded inclusively below and above (start..=end
).
A range only bounded exclusively above (..end
).
A range only bounded inclusively above (..=end
).
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference
Counted’.
Wraps a borrowed reference to a value in a RefCell
box.
A wrapper type for an immutably borrowed value from a RefCell<T>
.
A mutable memory location with dynamically checked borrow rules
A wrapper type for a mutably borrowed value from a RefCell<T>
.
An iterator that repeats an element endlessly.
An iterator that repeats an element an exact number of times.
An iterator that repeats elements of type A
endlessly by
applying the provided closure F: FnMut() -> A
.
A double-ended iterator with the direction inverted.
A helper struct for reverse ordering.
A reader-writer lock
RAII structure used to release the shared read access of a lock when
dropped.
RAII structure used to release the exclusive write access of a lock when
dropped.
Provides intentionally-saturating arithmetic on T
.
An iterator to maintain state while iterating another iterator.
An iterator that skips over n
elements of iter
.
An iterator that rejects elements while predicate
returns true
.
An IPv4 socket address.
An IPv6 socket address.
A splicing iterator for Vec
.
An iterator over the non-ASCII-whitespace substrings of a string,
separated by any amount of ASCII whitespace.
An iterator over the mutable subslices of the vector which are separated
by elements that match pred
. Unlike SplitMut
, it contains the matched
parts in the ends of the subslices.
An iterator over the mutable subslices of the vector which are separated
by elements that match pred
.
An iterator over subslices separated by elements that match a predicate
function, limited to a given number of splits.
An iterator over the non-whitespace substrings of a string,
separated by any amount of whitespace.
An iterator for stepping iterators by a custom amount.
A UTF-8–encoded, growable string.
A new iterator where each successive item is computed based on the preceding one.
An iterator that only iterates over the first n
iterations of iter
.
An iterator that only accepts elements while predicate
returns true
.
A TCP socket server, listening for connections.
A TCP stream between a local and a remote socket.
Returns an iterator that yields the lowercase equivalent of a char
.
Returns an iterator that yields the uppercase equivalent of a char
.
The error type returned when a checked char conversion fails.
The error type returned when a checked integral type conversion fails.
The error type returned when a conversion from a slice to an array fails.
The error type for try_reserve
methods.
A TypeId
represents a globally unique identifier for a type.
A UDP socket.
The core primitive for interior mutability in Rust.
An iterator used to decode a slice of mostly UTF-8 bytes to string slices
(
&str
) and byte slices (
&[u8]
).
Errors which can occur when attempting to interpret a sequence of
u8
as a string.
A contiguous growable array type, written as Vec<T>
, short for ‘vector’.
A double-ended queue implemented with a growable ring buffer.
A type indicating whether a timed wait on a condition variable returned
due to a time out or not.
An iterator over overlapping subslices of length size
.
Provides intentionally-wrapped arithmetic on T
.
An iterator that iterates two other iterators simultaneously.
A type storing a usize
which is a power of two, and thus
represents a possible alignment in the Rust abstract machine.
An iterator over a slice in (non-overlapping) mutable chunks (N
elements
at a time), starting at the beginning of the slice.
A windowed iterator over a slice in overlapping chunks (N
elements at a
time), starting at the beginning of the slice
Like Iterator::by_ref
, but requiring Sized
so it can forward generics.
The metadata for a Dyn = dyn SomeTrait
trait object type.
Exclusive
provides only mutable access, also referred to as exclusive
access to the underlying value. It provides no immutable, or shared
access to the underlying value.
An iterator which uses a closure to determine if an element should be removed.
An iterator adapter that places a separator between all elements.
An iterator adapter that places a separator between all elements.
An iterator over the mapped windows of another iterator.
An RAII mutex guard returned by MutexGuard::map
, which can point to a
subfield of the protected data. When this structure is dropped (falls out
of scope), the lock will be unlocked.
RAII structure used to release the shared read access of a lock when
dropped, which can point to a subfield of the protected data.
RAII structure used to release the exclusive write access of a lock when
dropped, which can point to a subfield of the protected data.
A re-entrant mutual exclusion lock
An RAII implementation of a “scoped lock” of a re-entrant lock. When this
structure is dropped (falls out of scope), the lock will be unlocked.
ThinBox.
Implement FromResidual<Yeet<T>>
on your type to enable
do yeet expr
syntax in functions returning your type.
The addition operator +
.
The addition assignment operator +=
.
A trait to emulate dynamic typing.
Used to do a cheap mutable-to-mutable reference conversion.
Used to do a cheap reference-to-reference conversion.
Extension methods for ASCII-subset only operations.
An async-aware version of the
Fn
trait.
An async-aware version of the
FnMut
trait.
An async-aware version of the
FnOnce
trait.
The bitwise AND operator &
.
The bitwise AND assignment operator &=
.
The bitwise OR operator |
.
The bitwise OR assignment operator |=
.
The bitwise XOR operator ^
.
The bitwise XOR assignment operator ^=
.
A trait for borrowing data.
A trait for mutably borrowing data.
Used for immutable dereferencing operations, like *v
.
Used for mutable dereferencing operations, like in *v = 1;
.
The division operator /
.
The division assignment operator /=
.
An iterator able to yield elements from both ends.
Custom code within the destructor.
An iterator that knows its exact length.
Extend a collection with the contents of an iterator.
The version of the call operator that takes an immutable receiver.
The version of the call operator that takes a mutable receiver.
The version of the call operator that takes a by-value receiver.
Used to do value-to-value conversions while consuming the input value. It is the reciprocal of
Into
.
Parse a value from a string
An iterator that always continues to yield None
when exhausted.
Used for indexing operations (container[index]
) in immutable contexts.
Used for indexing operations (container[index]
) in mutable contexts.
A value-to-value conversion that consumes the input value. The
opposite of
From
.
A trait for dealing with iterators.
The multiplication operator *
.
The multiplication assignment operator *=
.
The unary negation operator -
.
The unary logical negation operator !
.
Trait for comparisons using the equality operator.
Trait to represent types that can be created by multiplying elements of an
iterator.
RangeBounds
is implemented by Rust’s built-in range types, produced
by range syntax like ..
, a..
, ..b
, ..=c
, d..e
, or f..=g
.
A marker trait representing types where a shared reference is considered
unwind safe.
The remainder operator %
.
The remainder assignment operator %=
.
The left shift operator <<
. Note that because this trait is implemented
for all integer types with multiple right-hand-side types, Rust’s type
checker has special handling for _ << _
, setting the result type for
integer operations to the type of the left-hand-side operand. This means
that though a << b
and a.shl(b)
are one and the same from an evaluation
standpoint, they are different when it comes to type inference.
The left shift assignment operator <<=
.
The right shift operator >>
. Note that because this trait is implemented
for all integer types with multiple right-hand-side types, Rust’s type
checker has special handling for _ >> _
, setting the result type for
integer operations to the type of the left-hand-side operand. This means
that though a >> b
and a.shr(b)
are one and the same from an evaluation
standpoint, they are different when it comes to type inference.
The right shift assignment operator >>=
.
A helper trait used for indexing operations.
The subtraction operator -
.
The subtraction assignment operator -=
.
Trait to represent types that can be created by summing up an iterator.
A generalization of Clone
to borrowed data.
A trait for objects which can be converted or resolved to one or more
SocketAddr
values.
A trait for converting a value to a String
.
Simple and safe type conversions that may fail in a controlled
way under some circumstances. It is the reciprocal of
TryInto
.
An attempted conversion that consumes self
, which may or may not be
expensive.
A marker trait which represents “panic safe” types in Rust.
Trait that indicates that this is a pointer or a wrapper for one,
where unsizing can be performed on the pointee.
The trait implemented by builtin coroutine types.
Perma-unstable marker trait. Indicates that the type has a well-behaved
Deref
(and, if applicable,
DerefMut
) implementation. This is relied on for soundness
of deref patterns.
DispatchFromDyn
is used in the implementation of dyn-compatibility checks (specifically
allowing arbitrary self types), to guarantee that a method’s receiver type can be dispatched on.
Supporting trait for inherent methods of f32
and f64
such as to_int_unchecked
.
Typically doesn’t need to be used directly.
Used to specify which residuals can be converted into which
crate::ops::Try
types.
OneSidedRange
is implemented for built-in range types that are unbounded
on one side. For example, a..
, ..b
and ..=c
implement OneSidedRange
,
but ..
, d..e
, and f..=g
do not.
Trait that indicates that this is a pointer or a wrapper for one, where
unsizing can be performed on the pointee when it is pinned.
Provides the pointer metadata type of any pointed-to type.
Indicates that a struct can be used as a method receiver.
That is, a type can use this type as a type of self
, like this:
Allows retrieving the canonical type implementing
Try
that has this type
as its residual and allows it to hold an
O
as its output.
Objects that have a notion of successor and predecessor operations.
Marks that Src
is transmutable into Self
.
An iterator that reports an accurate length using size_hint.
A type that upholds all invariants of
Step
.
The ?
operator and try {}
blocks.
A marker trait for primitive types which can be zero.
Makes the path absolute without accessing the filesystem.
Compares the addresses of the two pointers for equality,
ignoring any metadata in fat pointers.
Returns the
ABI-required minimum alignment of a type in bytes.
Returns the
ABI-required minimum alignment of the type of the value that
val
points to in
bytes.
Invokes a closure, capturing the cause of an unwinding panic if one occurs.
Copies count * size_of::<T>()
bytes from src
to dst
. The source
and destination must not overlap.
Gets the current day, without the time.
Gets the current time, including the date and time.
Creates a new pointer that is dangling, but non-null and well-aligned.
Creates a new pointer that is dangling, but non-null and well-aligned.
Creates an iterator over the UTF-16 encoded code points in
iter
, returning
unpaired surrogates as
Err
s. Use
char::decode_utf16
instead.
Returns a value uniquely identifying the enum variant in v
.
Disposes of a value.
Executes the destructor (if any) of the pointed-to value.
Creates an iterator that yields nothing.
Compares raw pointers for equality.
Returns an iterator that produces an escaped version of a u8
.
Compares the addresses of the two function pointers for equality.
Takes ownership and “forgets” about the value without running its destructor.
Converts a boxed slice of bytes to a boxed string slice without checking
that the string contains valid UTF-8.
Converts a slice of bytes to a string slice.
Converts a mutable slice of bytes to a mutable string slice.
Converts a slice of bytes to a string slice without checking
that the string contains valid UTF-8.
Converts a slice of bytes to a string slice without checking
that the string contains valid UTF-8; mutable version.
Hash a raw pointer.
The identity function.
Determines whether the character is one of the permitted path
separators for the current platform.
Compares and returns the maximum of two values.
Returns the maximum of two values with respect to the specified comparison function.
Returns the element that gives the maximum value from the specified function.
Compares and returns the minimum of two values.
Returns the
ABI-required minimum alignment of a type in bytes.
Returns the
ABI-required minimum alignment of the type of the value that
val
points to in
bytes.
Returns the minimum of two values with respect to the specified comparison function.
Returns the element that gives the minimum value from the specified function.
Returns true
if dropping values of type T
matters.
Creates a null raw pointer.
Creates a null mutable raw pointer.
Creates an iterator that yields an element exactly once.
Creates an iterator that lazily generates a value exactly once by invoking
the provided closure.
Output
Panics the current thread with the given message as the panic payload.
Reads the value from src
without moving it. This leaves the
memory in src
unchanged.
Reads the value from src
without moving it. This leaves the
memory in src
unchanged.
Performs a volatile read of the value from src
without moving it. This
leaves the memory in src
unchanged.
Creates a new iterator that repeats a single element a given number of times.
Creates a new iterator that repeats elements of type A
endlessly by
applying the provided closure, the repeater, F: FnMut() -> A
.
Triggers a panic without invoking the panic hook.
Registers a custom panic hook, replacing the previously registered hook.
Returns the size of a type in bytes.
Returns the size of the pointed-to value in bytes.
Forms a raw slice from a pointer and a length.
Forms a raw mutable slice from a pointer and a length.
Creates a new iterator where each successive item is computed based on the preceding one.
Swaps count * size_of::<T>()
bytes between the two regions of memory
beginning at x
and y
. The two regions must not overlap.
Replaces dest
with the default value of T
, returning the previous dest
value.
Unregisters the current panic hook and returns it, registering the default hook
in its place.
Reinterprets the bits of a value of one type as another type.
Interprets src
as having type &Dst
, and then reads src
without moving
the contained value.
Returns the name of a type as a string slice.
Returns the type name of the pointed-to value as a string slice.
Bypasses Rust’s normal memory-initialization checks by pretending to
produce a value of type T
, while doing nothing at all.
Converts an address back to a pointer, picking up some previously ‘exposed’
provenance.
Converts an address back to a mutable pointer, picking up some previously ‘exposed’
provenance.
Creates a pointer with the given address and no
provenance.
Creates a pointer with the given address and no
provenance.
Overwrites a memory location with the given value without reading or
dropping the old value.
Sets count * size_of::<T>()
bytes of memory starting at dst
to
val
.
Overwrites a memory location with the given value without reading or
dropping the old value.
Performs a volatile write of a memory location with the given value without
reading or dropping the old value.
Returns the value of type T
represented by the all-zero byte-pattern.
Converts the arguments to iterators and zips them.
Invokes a closure, aborting if the closure unwinds.
Returns the
ABI-required minimum alignment of the type of the value that
val
points to in
bytes.
Makes all future panics abort directly without running the panic hook or unwinding.
Constructs a Box<T>
by calling the exchange_malloc
lang item and moving the argument into
the newly allocated memory. This is an intrinsic to avoid unnecessary copies.
Converts the arguments to iterators and links them together, in a chain.
Like
forget
, but also accepts unsized values.
Creates a new iterator where each iteration calls the provided coroutine.
Forms a mutable slice from a pointer range.
Forms a slice from a pointer range.
Checks whether the standard library’s panic hook will capture and print a
backtrace.
Extracts the metadata component of a pointer.
Compares and sorts two values, returning minimum and maximum.
Returns minimum and maximum values with respect to the specified comparison function.
Returns minimum and maximum values with respect to the specified key function.
Performs bounds checking of a range.
Configures whether the default panic hook will capture and display a
backtrace.
Returns the size of the pointed-to value in bytes.
Creates an array
[T; N]
where each fallible array element
T
is returned by the
cb
call.
Unlike
from_fn
, where the element creation can’t fail, this version will return an error
if any element creation was unsuccessful.
Performs bounds checking of a range without panicking.
Atomic combination of
take_hook
and
set_hook
. Use this to replace the panic handler with
a new panic handler that does something and then executes the old handler.
Returns the number of variants in the enum type T
.