Expand description
Basic functions for dealing with memory.
This module contains functions for querying the size and alignment of types, initializing and manipulating memory.
Structs
Opaque type representing the discriminant of an enum.
A wrapper to inhibit compiler from automatically calling T
’s destructor.
This wrapper is 0-cost.
Functions
Returns the ABI-required minimum alignment of the type of the value that val
points to in
bytes.
Bitwise-copies a value.
Like forget
, but also accepts unsized values.
Returns the size of the pointed-to value in bytes.
Returns the number of variants in the enum type T
.
Returns the ABI-required minimum alignment of the type of the value that val
points to in
bytes.
Returns a value uniquely identifying the enum variant in v
.
Disposes of a value.
Takes ownership and “forgets” about the value without running its destructor.
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 true
if dropping values of type T
matters.
Moves src
into the referenced dest
, returning the previous dest
value.
Returns the size of a type in bytes.
Returns the size of the pointed-to value in bytes.
Swaps the values at two mutable locations, without deinitializing either one.
Replaces dest
with the default value of T
, returning the previous dest
value.
Interprets src
as having type &U
, and then reads src
without moving
the contained value.
Bypasses Rust’s normal memory-initialization checks by pretending to
produce a value of type T
, while doing nothing at all.
Unions
A wrapper type to construct uninitialized instances of T
.