CombineReaders

Trait CombineReaders 

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 Readers, ExclusiveReaders or InitializedReaders.

Required Associated Types§

type ToBeRead<'b>

The (tuple) value that will be read from the combined readers.

Required Methods§

fn read<U>(&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

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.

Implementations on Foreign Types§

§

impl<T, U> CombineReaders for (&mut T, &mut U)

§

type ToBeRead<'x> = (&'x <T as CombinableReader>::ToBeRead, &'x <U as CombinableReader>::ToBeRead)

§

fn read<A>( &self, f: impl FnOnce(<(&mut T, &mut U) as CombineReaders>::ToBeRead<'_>) -> A, ) -> A

§

async fn wait_for_update(&mut self) -> &mut (&mut T, &mut U)

§

impl<T, U, V> CombineReaders for (&mut T, &mut U, &mut V)

§

type ToBeRead<'x> = (&'x <T as CombinableReader>::ToBeRead, &'x <U as CombinableReader>::ToBeRead, &'x <V as CombinableReader>::ToBeRead)

§

fn read<A>( &self, f: impl FnOnce(<(&mut T, &mut U, &mut V) as CombineReaders>::ToBeRead<'_>) -> A, ) -> A

§

async fn wait_for_update(&mut self) -> &mut (&mut T, &mut U, &mut V)

§

impl<T, U, V, W> CombineReaders for (&mut T, &mut U, &mut V, &mut W)

§

type ToBeRead<'x> = (&'x <T as CombinableReader>::ToBeRead, &'x <U as CombinableReader>::ToBeRead, &'x <V as CombinableReader>::ToBeRead, &'x <W as CombinableReader>::ToBeRead)

§

fn read<A>( &self, f: impl FnOnce(<(&mut T, &mut U, &mut V, &mut W) as CombineReaders>::ToBeRead<'_>) -> A, ) -> A

§

async fn wait_for_update(&mut self) -> &mut (&mut T, &mut U, &mut V, &mut W)

§

impl<T, U, V, W, X> CombineReaders for (&mut T, &mut U, &mut V, &mut W, &mut X)

§

type ToBeRead<'x> = (&'x <T as CombinableReader>::ToBeRead, &'x <U as CombinableReader>::ToBeRead, &'x <V as CombinableReader>::ToBeRead, &'x <W as CombinableReader>::ToBeRead, &'x <X as CombinableReader>::ToBeRead)

§

fn read<A>( &self, f: impl FnOnce(<(&mut T, &mut U, &mut V, &mut W, &mut X) as CombineReaders>::ToBeRead<'_>) -> A, ) -> A

§

async fn wait_for_update( &mut self, ) -> &mut (&mut T, &mut U, &mut V, &mut W, &mut X)

§

impl<T, U, V, W, X, Y> CombineReaders for (&mut T, &mut U, &mut V, &mut W, &mut X, &mut Y)

§

type ToBeRead<'x> = (&'x <T as CombinableReader>::ToBeRead, &'x <U as CombinableReader>::ToBeRead, &'x <V as CombinableReader>::ToBeRead, &'x <W as CombinableReader>::ToBeRead, &'x <X as CombinableReader>::ToBeRead, &'x <Y as CombinableReader>::ToBeRead)

§

fn read<A>( &self, f: impl FnOnce(<(&mut T, &mut U, &mut V, &mut W, &mut X, &mut Y) as CombineReaders>::ToBeRead<'_>) -> A, ) -> A

§

async fn wait_for_update( &mut self, ) -> &mut (&mut T, &mut U, &mut V, &mut W, &mut X, &mut Y)

§

impl<T, U, V, W, X, Y, Z> CombineReaders for (&mut T, &mut U, &mut V, &mut W, &mut X, &mut Y, &mut Z)

§

type ToBeRead<'x> = (&'x <T as CombinableReader>::ToBeRead, &'x <U as CombinableReader>::ToBeRead, &'x <V as CombinableReader>::ToBeRead, &'x <W as CombinableReader>::ToBeRead, &'x <X as CombinableReader>::ToBeRead, &'x <Y as CombinableReader>::ToBeRead, &'x <Z as CombinableReader>::ToBeRead)

§

fn read<A>( &self, f: impl FnOnce(<(&mut T, &mut U, &mut V, &mut W, &mut X, &mut Y, &mut Z) as CombineReaders>::ToBeRead<'_>) -> A, ) -> A

§

async fn wait_for_update( &mut self, ) -> &mut (&mut T, &mut U, &mut V, &mut W, &mut X, &mut Y, &mut Z)

Implementors§