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§
- Expands to the offset in bytes of a field from the beginning of the given type.
Structs§
- Opaque type representing the discriminant of an enum.
- A wrapper to inhibit the compiler from automatically callingT’s destructor. This wrapper is 0-cost.
- AssumeExperimental Configurable proof assumptions ofTransmuteFrom.
Traits§
- TransmuteFrom Experimental Marks thatSrcis transmutable intoSelf.
Functions§
- Returns the ABI-required minimum alignment of a type in bytes.
- Returns the ABI-required minimum alignment of the type of the value thatvalpoints to in bytes.
- Returns a value uniquely identifying the enum variant inv.
- Disposes of a value.
- Takes ownership and “forgets” about the value without running its destructor.
- min_align_ of Deprecated Returns the ABI-required minimum alignment of a type in bytes.
- min_align_ of_ val Deprecated Returns the ABI-required minimum alignment of the type of the value thatvalpoints to in bytes.
- Returnstrueif dropping values of typeTmatters.
- Movessrcinto the referenceddest, returning the previousdestvalue.
- 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.
- Replacesdestwith the default value ofT, returning the previousdestvalue.
- Reinterprets the bits of a value of one type as another type.
- Interpretssrcas having type&Dst, and then readssrcwithout moving the contained value.
- uninitialized⚠Deprecated Bypasses Rust’s normal memory-initialization checks by pretending to produce a value of typeT, while doing nothing at all.
- Returns the value of typeTrepresented by the all-zero byte-pattern.
- align_of_ ⚠val_ raw Experimental Returns the ABI-required minimum alignment of the type of the value thatvalpoints to in bytes.
- copyExperimental Bitwise-copies a value.
- forget_unsized Experimental Likeforget, but also accepts unsized values.
- size_of_ ⚠val_ raw Experimental Returns the size of the pointed-to value in bytes.
- variant_count Experimental Returns the number of variants in the enum typeT.
Unions§
- A wrapper type to construct uninitialized instances ofT.