Module std::mem

Working with memory (allocation, slices, copying, ...)

The main feature of this module is the slice type, which is a pointer to a region of memory. &[T] is a slice (read-only) of T, and &mut [T] is a mutable slice.


Types that can be "freed".
Types that implement move semantics
Types that be copied non-trivially (usually types containing a heap allocation).
Types that can be viewed as const slices
Types that can be viewed as mutable slices


Fat pointers to a contiguous region of memory.
Iterator over elements of a slice
Iterator over pointers to elements of a slice