BatchReceiver

Trait BatchReceiver 

Source
pub trait BatchReceiver<T> {
    // Required method
    unsafe fn push_many_and_slice(&self, first: &[T], last: &[T], slice: &[T]);

    // Provided method
    unsafe fn push_many_and_one(&self, first: &[T], last: &[T], value: T) { ... }
}
Expand description

A batch receiver of the multi-consumer queue. It is used to move half of the values from the queue to this receiver on overflow.

This library provides the MutexVecQueue that implements this trait.

Required Methods§

Source

unsafe fn push_many_and_slice(&self, first: &[T], last: &[T], slice: &[T])

Pushes a batch of values to the receiver.

It first pushes the first slice, then the last slice and finally the slice.

It has such an interesting signature because it can be used in ring-based queues.

It may be non-lock-free.

§Safety

If T is not Copy, the caller should forget the provided slices.

Provided Methods§

Source

unsafe fn push_many_and_one(&self, first: &[T], last: &[T], value: T)

Pushes a batch of values to the receiver.

It first pushes the first slice, then the last slice and finally the value.

It has such an interesting signature because it can be used in ring-based queues.

It may be non-lock-free.

§Safety

If T is not Copy, the caller should forget the provided slices and the provided value.

Implementors§