Basic functions for dealing with memory.
This module contains functions for querying the size and alignment of types, initializing and manipulating memory.
Discriminant | Opaque type representing the discriminant of an enum. |
align_of | Returns the ABI-required minimum alignment of a type. |
align_of_val | Returns the ABI-required minimum alignment of the type of the value that |
discriminant | Returns a value uniquely identifying the enum variant in |
drop | Disposes of a value. |
forget | Leaks 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. |
min_align_of_val | [ Deprecated ] Returns the ABI-required minimum alignment of the type of the value that |
needs_drop | Returns whether dropping values of type |
replace | Replaces the value at a mutable location with a new one, returning the old value, without deinitializing either one. |
size_of | Returns the size of a type in bytes. |
size_of_val | Returns the size of the pointed-to value in bytes. |
swap | Swaps the values at two mutable locations, without deinitializing either one. |
transmute⚠ | Reinterprets the bits of a value of one type as another type. |
transmute_copy⚠ | Interprets |
uninitialized⚠ | Bypasses Rust's normal memory-initialization checks by pretending to produce a value of type |
zeroed⚠ | Creates a value whose bytes are all zero. |
unreachable⚠ | [ Experimental ] Tells LLVM that this point in the code is not reachable, enabling further optimizations. |
ManuallyDrop | A wrapper to inhibit compiler from automatically calling |
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/mem/index.html