Trait CombineReaders
pub trait CombineReaders {
type ToBeRead<'b>;
// Required methods
fn read<U>(&mut self, f: impl FnOnce(Self::ToBeRead<'_>) -> U) -> U;
async fn wait_for_update(&mut self) -> &mut Self;
fn is_updated(&self) -> bool;
}Expand description
Allows combining (nearly) arbitrary amounts of Readers or ExclusiveReaders.
Required Associated Types§
type ToBeRead<'b>
type ToBeRead<'b>
The (tuple) value that will be read from the combined readers.
Required Methods§
fn read<U>(&mut self, f: impl FnOnce(Self::ToBeRead<'_>) -> U) -> U
fn read<U>(&mut self, f: impl FnOnce(Self::ToBeRead<'_>) -> U) -> U
Reads a tuple of values from all combined readers in the provided function.
async fn wait_for_update(&mut self) -> &mut Self
async fn wait_for_update(&mut self) -> &mut Self
Observes the combined readers for updates.
Will return if any of the readers is updated.
This returns &mut Self to allow chaining a call to read.
fn is_updated(&self) -> bool
fn is_updated(&self) -> bool
Returns true if any of the readers was updated.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.