Struct triple_buffer::TripleBuffer [] [src]

pub struct TripleBuffer<T: 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: the producer submits regular updates, and the consumer accesses the latest available value whenever it feels like it.

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 + Send> TripleBuffer<T>
[src]

[src]

Construct a triple buffer with a certain initial value

impl<T: Send> TripleBuffer<T>
[src]

[src]

Extract input and output of the triple buffer

Trait Implementations

impl<T: Debug + Send> Debug for TripleBuffer<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: Default + Send> Default for TripleBuffer<T>
[src]

[src]

Construct a triple buffer with a default-constructed value

impl<T: Clone + Send> Clone for TripleBuffer<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: PartialEq + Send> PartialEq for TripleBuffer<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.