pub struct ParallelScope<'a> { /* private fields */ }Expand description
A handle for spawning durable steps with eagerly-assigned, contiguous step ids.
Returned by DurableContext::parallel. Each step call assigns its id
synchronously, before returning the future, so building a batch of children fixes their ids in
construction order — completion order is then irrelevant (INV-2).
Implementations§
Source§impl<'a> ParallelScope<'a>
impl<'a> ParallelScope<'a>
Sourcepub fn step<T, F, Fut>(
&self,
desc: StepDescriptor,
op: F,
) -> impl Future<Output = Result<DurableStep<T>, DurableError>> + Send + 'awhere
T: Serialize + DeserializeOwned + Send + 'a,
F: FnOnce(StepHandle) -> Fut + Send + 'a,
Fut: Future<Output = Result<T, StepError>> + Send + 'a,
pub fn step<T, F, Fut>(
&self,
desc: StepDescriptor,
op: F,
) -> impl Future<Output = Result<DurableStep<T>, DurableError>> + Send + 'awhere
T: Serialize + DeserializeOwned + Send + 'a,
F: FnOnce(StepHandle) -> Fut + Send + 'a,
Fut: Future<Output = Result<T, StepError>> + Send + 'a,
Construct a durable step future with its id assigned eagerly.
The returned future runs (or replays) the step when awaited; its StepId is already fixed.
Collect the futures synchronously, then await them concurrently.
§Errors
The awaited future fails for the same reasons as DurableContext::step.
Trait Implementations§
Source§impl<'a> Clone for ParallelScope<'a>
impl<'a> Clone for ParallelScope<'a>
Source§fn clone(&self) -> ParallelScope<'a>
fn clone(&self) -> ParallelScope<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ParallelScope<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ParallelScope<'a>
impl<'a> !UnwindSafe for ParallelScope<'a>
impl<'a> Freeze for ParallelScope<'a>
impl<'a> Send for ParallelScope<'a>
impl<'a> Sync for ParallelScope<'a>
impl<'a> Unpin for ParallelScope<'a>
impl<'a> UnsafeUnpin for ParallelScope<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more