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§
Sourcefn batch_find<M, F, FutOp>(self, map_to_future: M, find: F) -> Option<I>
fn batch_find<M, F, FutOp>(self, map_to_future: M, find: F) -> Option<I>
batch_map
s then finds the object for which find
with the results
of awaiting map_to_future(item)
returns true
.
Sourcefn batch_map<F, FutOp>(self, map: F) -> impl Iterator<Item = FutOp>
fn batch_map<F, FutOp>(self, map: F) -> impl Iterator<Item = FutOp>
Maps the collection to compositor requests, batching all calls.
Sourcefn batch_filter<M, F, FutOp>(
self,
map_to_future: M,
predicate: F,
) -> impl Iterator<Item = I>
fn batch_filter<M, F, FutOp>( self, map_to_future: M, predicate: F, ) -> impl Iterator<Item = I>
batch_map
s then filters for objects for which predicate
with the
results of awaiting map_to_future(item)
returns true
.