[][src]Struct lock_free_multi_producer_single_consumer_ring_buffer::RingBuffer

pub struct RingBuffer<T: Copy> { /* fields omitted */ }

A ring buffer for sending lock-less bursts of messages.

Not particularly cheap to consume from (as it walks all producers) so try to use as few producers as possible and consume as much as possible with each call.

Multi-Producer, Single-Consumer (MP-SC).

Methods

impl<T: Copy> RingBuffer<T>
[src]

pub fn new(
    capacity: usize,
    number_of_producers: usize
) -> (RingBufferConsumer<T>, Vec<RingBufferProducer<T>>)
[src]

Creates a new ring buffer and returns a consumer to it and producers for it.

When the last consumer or producer is dropped, the ring buffer is freed.

Trait Implementations

impl<T: Eq + Copy> Eq for RingBuffer<T>
[src]

impl<T: PartialOrd + Copy> PartialOrd<RingBuffer<T>> for RingBuffer<T>
[src]

impl<T: PartialEq + Copy> PartialEq<RingBuffer<T>> for RingBuffer<T>
[src]

impl<T: Clone + Copy> Clone for RingBuffer<T>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Ord + Copy> Ord for RingBuffer<T>
[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<T: Debug + Copy> Debug for RingBuffer<T>
[src]

Auto Trait Implementations

impl<T> !Send for RingBuffer<T>

impl<T> !Sync for RingBuffer<T>

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]