Trait Batch

Source
pub trait Batch<I> {
    // Required methods
    fn batch_find<M, F, FutOp>(self, map_to_future: M, find: F) -> Option<I>
       where Self: Sized,
             M: for<'a> FnMut(&'a I) -> Pin<Box<dyn Future<Output = FutOp> + 'a>>,
             F: FnMut(&FutOp) -> bool;
    fn batch_map<F, FutOp>(self, map: F) -> impl Iterator<Item = FutOp>
       where Self: Sized,
             F: for<'a> FnMut(&'a I) -> Pin<Box<dyn Future<Output = FutOp> + 'a>>;
    fn batch_filter<M, F, FutOp>(
        self,
        map_to_future: M,
        predicate: F,
    ) -> impl Iterator<Item = I>
       where Self: Sized,
             M: for<'a> FnMut(&'a I) -> Pin<Box<dyn Future<Output = FutOp> + 'a>>,
             F: FnMut(FutOp) -> bool;
}
Expand description

Methods for batch sending API requests to the compositor.

Required Methods§

Source

fn batch_find<M, F, FutOp>(self, map_to_future: M, find: F) -> Option<I>
where Self: Sized, M: for<'a> FnMut(&'a I) -> Pin<Box<dyn Future<Output = FutOp> + 'a>>, F: FnMut(&FutOp) -> bool,

batch_maps then finds the object for which find with the results of awaiting map_to_future(item) returns true.

Source

fn batch_map<F, FutOp>(self, map: F) -> impl Iterator<Item = FutOp>
where Self: Sized, F: for<'a> FnMut(&'a I) -> Pin<Box<dyn Future<Output = FutOp> + 'a>>,

Maps the collection to compositor requests, batching all calls.

Source

fn batch_filter<M, F, FutOp>( self, map_to_future: M, predicate: F, ) -> impl Iterator<Item = I>
where Self: Sized, M: for<'a> FnMut(&'a I) -> Pin<Box<dyn Future<Output = FutOp> + 'a>>, F: FnMut(FutOp) -> bool,

batch_maps then filters for objects for which predicate with the results of awaiting map_to_future(item) returns true.

Implementors§

Source§

impl<T: IntoIterator<Item = I>, I> Batch<I> for T