Struct foyer_common::async_batch_pipeline::LeaderToken
source · pub struct LeaderToken<T, R> { /* private fields */ }Expand description
The token returns by AsyncBatchPipeline::accumulate if the caller is the leader of the batch.
Implementations§
source§impl<T, R> LeaderToken<T, R>
impl<T, R> LeaderToken<T, R>
sourcepub fn pipeline<FR, F, FU, NS>(
self,
new_state: NS,
fr: FR,
f: F
) -> JoinHandle<()>
pub fn pipeline<FR, F, FU, NS>( self, new_state: NS, fr: FR, f: F ) -> JoinHandle<()>
Pipeline execute futures.
new_state
- Receives the reference of the old state and returns the new state.
f
- Receives the owned old state and returns a future.
- The future will be polled after handling the previous result.
- The future is guaranteed to be execute one by one in order.
fr
- Handle the previous result.
Auto Trait Implementations§
impl<T, R> Freeze for LeaderToken<T, R>
impl<T, R> !RefUnwindSafe for LeaderToken<T, R>
impl<T, R> Send for LeaderToken<T, R>
impl<T, R> Sync for LeaderToken<T, R>
impl<T, R> Unpin for LeaderToken<T, R>
impl<T, R> !UnwindSafe for LeaderToken<T, R>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more