Struct triple_buffer::TripleBuffer
[−]
[src]
pub struct TripleBuffer<T: Clone + PartialEq + Send> { /* fields omitted */ }
A triple buffer, useful for nonblocking and thread-safe data sharing
A triple buffer is a single-producer single-consumer nonblocking communication channel which behaves like a shared variable: writer submits regular updates, reader accesses latest available value at any time.
The input and output fields of this struct are what producers and consumers actually use in practice. They can safely be moved away from the TripleBuffer struct after construction, and are further documented below.
Methods
impl<T: Clone + PartialEq + Send> TripleBuffer<T>
[src]
fn new(initial: T) -> Self
Construct a triple buffer with a certain initial value
fn split(self) -> (TripleBufferInput<T>, TripleBufferOutput<T>)
Extract input and output of the triple buffer
Trait Implementations
impl<T: Debug + Clone + PartialEq + Send> Debug for TripleBuffer<T>
[src]
impl<T: Clone + PartialEq + Send> Clone for TripleBuffer<T>
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more