Skip to main content

StepHandle

Struct StepHandle 

Source
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:

  1. Either within a future step,
  2. 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>

Source

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.

Source

pub async fn into_value(self, _token: &StepHandleToken<S>) -> T

Resolves to the output from a step, T.

Source

pub fn into_shared(self) -> SharedStepHandle<T, S>
where T: Clone,

Returns a shared handle.

A SharedStepHandle can be used to retrieve the output of a future across multiple dependent steps.

Trait Implementations§

Source§

impl<T, S> Debug for StepHandle<T, S>
where T: Debug,

Source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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>
where S: Send, T: Send,

§

impl<T, S> Sync for StepHandle<T, S>
where S: Sync, T: Send,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.