Trait timely_communication::Pull
source · pub trait Pull<T> {
// Required method
fn pull(&mut self) -> &mut Option<T>;
// Provided method
fn recv(&mut self) -> Option<T> { ... }
}
Expand description
Pulling elements of type T
.
Required Methods§
sourcefn pull(&mut self) -> &mut Option<T>
fn pull(&mut self) -> &mut Option<T>
Pulls an element and provides the opportunity to take ownership.
The puller may mutate the result, in particular take ownership of the data by
replacing it with other data or even None
. This allows the puller to return
resources to the implementor.
If pull
returns None
this conventionally signals that no more data is available
at the moment, and the puller should find something better to do.