Trait ringbuf::ring_buffer::Container
source · pub unsafe trait Container<T> {
type Internal;
// Required methods
fn into_internal(self) -> Self::Internal;
unsafe fn from_internal(this: Self::Internal) -> Self;
fn as_mut_ptr(this: &Self::Internal) -> *mut MaybeUninit<T>;
fn len(this: &Self::Internal) -> usize;
}
Expand description
Abstract container for the ring buffer.
Container items must be stored as a contiguous array.
Safety
Self::len
/[Self::is_empty
] must always return the same value.
Container must not cause data race on concurrent [Self::as_mut_slice
]/Self::as_mut_ptr
calls.
Required Associated Types§
Required Methods§
sourcefn into_internal(self) -> Self::Internal
fn into_internal(self) -> Self::Internal
Transform container to internal representation.
sourceunsafe fn from_internal(this: Self::Internal) -> Self
unsafe fn from_internal(this: Self::Internal) -> Self
sourcefn as_mut_ptr(this: &Self::Internal) -> *mut MaybeUninit<T>
fn as_mut_ptr(this: &Self::Internal) -> *mut MaybeUninit<T>
Return pointer to the beginning of the container items.