Expand description
Basic functions for dealing with memory.
This module contains functions for querying the size and alignment of types, initializing and manipulating memory.
Macros§
- offset_
of Non- ferrocene_certified
- Expands to the offset in bytes of a field from the beginning of the given type.
Structs§
- Discriminant
Non- ferrocene_certified
- Opaque type representing the discriminant of an enum.
- Manually
Drop Non- ferrocene_certified
- A wrapper to inhibit the compiler from automatically calling
T
’s destructor. This wrapper is 0-cost. - Assume
Experimental Non- ferrocene_certified
- Configurable proof assumptions of
TransmuteFrom
. - Drop
Guard Experimental Non- ferrocene_certified
- Wrap a value and run a closure when dropped.
Traits§
- Transmute
From Experimental Non- ferrocene_certified
- Marks that
Src
is transmutable intoSelf
.
Functions§
- align_
of - Returns the ABI-required minimum alignment of a type in bytes.
- align_
of_ val Non- ferrocene_certified
- Returns the ABI-required minimum alignment of the type of the value that
val
points to in bytes. - discriminant
Non- ferrocene_certified
- Returns a value uniquely identifying the enum variant in
v
. - drop
- Disposes of a value.
- forget
Non- ferrocene_certified
- Takes ownership and “forgets” about the value without running its destructor.
- min_
align_ of Deprecated Non- ferrocene_certified
- Returns the ABI-required minimum alignment of a type in bytes.
- min_
align_ of_ val Deprecated Non- ferrocene_certified
- Returns the ABI-required minimum alignment of the type of the value that
val
points to in bytes. - needs_
drop Non- ferrocene_certified
- Returns
true
if dropping values of typeT
matters. - replace
Non- ferrocene_certified
- Moves
src
into the referenceddest
, returning the previousdest
value. - size_of
- Returns the size of a type in bytes.
- size_
of_ val Non- ferrocene_certified
- Returns the size of the pointed-to value in bytes.
- swap
Non- ferrocene_certified
- Swaps the values at two mutable locations, without deinitializing either one.
- take
Non- ferrocene_certified
- Replaces
dest
with the default value ofT
, returning the previousdest
value. - transmute⚠
- Reinterprets the bits of a value of one type as another type.
- transmute_
copy ⚠Non- ferrocene_certified
- Interprets
src
as having type&Dst
, and then readssrc
without moving the contained value. - uninitialized⚠
Deprecated Non- ferrocene_certified
- Bypasses Rust’s normal memory-initialization checks by pretending to
produce a value of type
T
, while doing nothing at all. - zeroed⚠
Non- ferrocene_certified
- Returns the value of type
T
represented by the all-zero byte-pattern. - align_
of_ ⚠val_ raw Experimental Non- ferrocene_certified
- Returns the ABI-required minimum alignment of the type of the value that
val
points to in bytes. - conjure_
zst ⚠Experimental Non- ferrocene_certified
- Create a fresh instance of the inhabited ZST type
T
. - copy
Experimental Non- ferrocene_certified
- Bitwise-copies a value.
- forget_
unsized Experimental Non- ferrocene_certified
- Like
forget
, but also accepts unsized values. - size_
of_ ⚠val_ raw Experimental Non- ferrocene_certified
- Returns the size of the pointed-to value in bytes.
- variant_
count Experimental Non- ferrocene_certified
- Returns the number of variants in the enum type
T
.
Unions§
- Maybe
Uninit Non- ferrocene_certified
- A wrapper type to construct uninitialized instances of
T
.