pub struct StepHandle<T, S> { /* private fields */ }Expand description
A way to obtain a step’s result.
This handle can be used to transfer data between steps.
StepHandles must be awaited:
- Either within a future step,
- Or after the engine completes executing.
To ensure this, the only way to retrieve a StepHandle is with a
StepHandleToken, returned by:
It is important that StepHandles never be awaited outside the
context of a step that comes afterwards – doing so will cause an
immediate deadlock.
Dropping a StepHandle has no effect on whether the step itself
runs.
Implementations§
Source§impl<T, S> StepHandle<T, S>
impl<T, S> StepHandle<T, S>
Sourcepub fn ready(value: T) -> Self
pub fn ready(value: T) -> Self
Creates a StepHandle that immediately provides a value.
The value is always available and can be used within any steps.
Sourcepub async fn into_value(self, _token: &StepHandleToken<S>) -> T
pub async fn into_value(self, _token: &StepHandleToken<S>) -> T
Resolves to the output from a step, T.
Returns a shared handle.
A SharedStepHandle can be used to retrieve the output of a
future across multiple dependent steps.
Trait Implementations§
Auto Trait Implementations§
impl<T, S> Freeze for StepHandle<T, S>
impl<T, S> !RefUnwindSafe for StepHandle<T, S>
impl<T, S> Send for StepHandle<T, S>
impl<T, S> Sync for StepHandle<T, S>
impl<T, S> Unpin for StepHandle<T, S>where
S: Unpin,
impl<T, S> UnsafeUnpin for StepHandle<T, S>
impl<T, S> !UnwindSafe for StepHandle<T, S>
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