Skip to main content

BufGuard

Trait BufGuard 

Source
#[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§

Source

fn with_capacity(capacity: usize) -> Self

🔬This is a nightly-only experimental API. (slice_internals)

Creates new buffer that holds at least capacity memory.

Source

fn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<T>]

🔬This is a nightly-only experimental API. (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".

Implementors§