Type Alias mutringbuf::ConcurrentHeapRB

source ·
pub type ConcurrentHeapRB<T> = ConcurrentMutRingBuf<HeapStorage<T>>;
Expand description

A heap-allocated ring buffer usable in concurrent environment.

Aliased Type§

struct ConcurrentHeapRB<T> { /* private fields */ }

Implementations§

source§

impl<T> ConcurrentHeapRB<T>

source

pub unsafe fn new_zeroed(capacity: usize) -> Self

Creates a new concurrent heap-allocated buffer with given capacity and zeroed (uninitialised) elements.

§Safety

The buffer must be then initialised using proper ProdIter methods (*_init ones).

source

pub fn default(capacity: usize) -> Self
where T: Default + Clone,

Creates a new concurrent heap-allocated buffer with given capacity and elements initialised to default.

Trait Implementations§

source§

impl<T> From<Vec<T>> for ConcurrentHeapRB<T>

source§

fn from(value: Vec<T>) -> Self

Constructs a ConcurrentHeapRB using the passed vector. Note that the length of the buffer will be equal to the length of teh vector, and not to its capacity.