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§
- Manually
Drop - A wrapper to inhibit the compiler from automatically calling
T’s destructor. This wrapper is 0-cost.
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
valpoints to in bytes. - drop
- Disposes of a value.
- forget
- Takes ownership and “forgets” about the value without running its destructor.
- needs_
drop - Returns
trueif dropping values of typeTmatters. - replace
- Moves
srcinto the referenceddest, returning the previousdestvalue. - size_of
- Returns the size of a type in bytes.
- size_
of_ val - Returns the size of the pointed-to value in bytes.
- transmute⚠
- Reinterprets the bits of a value of one type as another type.
- transmute_
copy ⚠ - Interprets
srcas having type&Dst, and then readssrcwithout moving the contained value.
Unions§
- Maybe
Uninit - A wrapper type to construct uninitialized instances of
T.