oneshot

Function oneshot 

Source
pub fn oneshot<T>() -> (OneShotSender<T>, OneShotReceiver<T>)
Expand description

Create a single-use channel. Under water this might be implemented as a bounded(1), but more efficient implementations might exist.

Both the sender and receiver take self instead of &self or &mut self, so they can only be used once.