#[doc(hidden)]pub trait BufGuard<T> {
// Required methods
fn with_capacity(capacity: usize) -> Self;
fn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<T>];
}🔬This is a nightly-only experimental API. (
slice_internals)Expand description
Abstracts owned memory buffer, so that sort code can live in core where no allocation is possible. This trait can then be implemented in a place that has access to allocation.
Required Methods§
Sourcefn with_capacity(capacity: usize) -> Self
🔬This is a nightly-only experimental API. (slice_internals)
fn with_capacity(capacity: usize) -> Self
slice_internals)Creates new buffer that holds at least capacity memory.
Sourcefn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<T>]
🔬This is a nightly-only experimental API. (slice_internals)
fn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<T>]
slice_internals)Returns mutable access to uninitialized memory owned by the buffer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".