doc.rust-lang.org
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns the remaining items of this iterator as a mutable slice.
method
alloc
Stable since 1.15.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_slice(&self) -> &[T]
Returns the remaining items of this iterator as a slice.
method
alloc
Stable since 1.15.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Splice<'a, I, A>
A splicing iterator for Vec.
struct
alloc
Stable since 1.21.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod core
The Rust Core Library
module
core
Stable since 1.6.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod alloc
Memory allocation APIs
module
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe trait GlobalAlloc
A memory allocator that can be registered as the standard library’s default through the #[global_allocator] attribute.
trait
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given layout.
method
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
Behaves like alloc, but also ensures that the contents are set to zero before being returned.
method
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
Deallocates the block of memory at the given ptr pointer with the given layout.
method
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
Shrinks or grows a block of memory to the given new_size in bytes. The block is described by the given ptr pointer and layout.
method
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Layout
Layout of a block of memory.
struct
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn align(&self) -> usize
The minimum byte alignment for a memory block of this layout.
method
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn align_to(&self, align: usize) -> Result<Self, LayoutError>
Creates a layout describing the record that can hold a value of the same layout as self, but that also is aligned to alignment align (measured in bytes).
method
core
Stable since 1.44.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn array<T>(n: usize) -> Result<Self, LayoutError>
Creates a layout describing the record for a [T; n].
associated_function
core
Stable since 1.44.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn dangling_ptr(&self) -> NonNull<u8>
Creates a NonNull that is dangling, but well-aligned for this Layout.
method
core
Stable since 1.95.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn extend(&self, next: Self) -> Result<(Self, usize), LayoutError>
Creates a layout describing the record for self followed by next, including any necessary padding to ensure that next will be properly aligned, but no trailing padding.
method
core
Stable since 1.44.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn extend_packed(&self, next: Self) -> Result<Self, LayoutError>
Creates a layout describing the record for self followed by next with no additional padding between the two. Since no padding is inserted, the alignment of next is irrelevant, and is not incorporated at all into the resulting layout.
method
core
Stable since 1.95.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn for_value<T>(t: &T) -> Self
Produces layout describing a record that could be used to allocate backing structure for T (which could be a trait or other unsized type like a slice).
associated_function
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn for_value_raw<T>(val: *const T) -> Self
Produces layout describing a record that could be used to allocate backing structure for T (which could be a trait or other unsized type like a slice).
associated_function
core
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_size_align(size: usize, align: usize) -> Result<Self, LayoutError>
Constructs a Layout from a given size and align, or returns LayoutError if any of the following conditions are not met:
associated_function
core
Stable since 1.28.0
Version 1.100.0-nightly