pub struct BlockingUpdate<T> {
pub value: T,
/* private fields */
}Expand description
Helper for blocking operations with timeout
let tally = sender.get_tally_update(Duration::from_secs(5));
tally.value; // This contains the current tally state even if nothing changed
if tally.value_updated(){
println!("Tally is now: {:?}", tally.value);
}Fields§
§value: TImplementations§
Source§impl<T> BlockingUpdate<T>
impl<T> BlockingUpdate<T>
Sourcepub fn timeout_reached(&self) -> bool
pub fn timeout_reached(&self) -> bool
Indicates that the timeout was reached before the operation could finish otherwise
Sourcepub fn value_updated(&self) -> bool
pub fn value_updated(&self) -> bool
Indicates that the operation finished within the timeout