Module mem

Module mem 

1.6.0 · Source
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§

ManuallyDrop
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 val points to in bytes.
drop
Disposes of a value.
forget
Takes ownership and “forgets” about the value without running its destructor.
needs_drop
Returns true if dropping values of type T matters.
replace
Moves src into the referenced dest, returning the previous dest value.
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 src as having type &Dst, and then reads src without moving the contained value.

Unions§

MaybeUninit
A wrapper type to construct uninitialized instances of T.