pub trait CombineReaders {
type ToBeRead<'b>;
// Required methods
fn read<U>(&self, f: impl FnOnce(Self::ToBeRead<'_>) -> U) -> U;
async fn wait_for_update(&mut self) -> &mut Self;
}
Expand description
Allows combining (nearly) arbitrary amounts of Reader
s, ExclusiveReader
s or InitializedReader
s.
Required Associated Types§
Required Methods§
Sourcefn read<U>(&self, f: impl FnOnce(Self::ToBeRead<'_>) -> U) -> U
fn read<U>(&self, f: impl FnOnce(Self::ToBeRead<'_>) -> U) -> U
Reads a tuple of values from all combined readers in the provided function.
Sourceasync 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
.
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.