pub struct NodeFn<S, F> { /* private fields */ }Expand description
Closure adapter — wrap any Fn(&S, &NodeCtx) -> Future as a Node.
Trait Implementations§
Source§impl<S, F, Fut> Node<S> for NodeFn<S, F>
impl<S, F, Fut> Node<S> for NodeFn<S, F>
Source§fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 S,
ctx: &'life2 NodeCtx<'life3>,
) -> Pin<Box<dyn Future<Output = Result<NodeOut<S>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 S,
ctx: &'life2 NodeCtx<'life3>,
) -> Pin<Box<dyn Future<Output = Result<NodeOut<S>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute one superstep of this node.
Source§fn retry_policy(&self) -> Option<NodeRetryPolicy>
fn retry_policy(&self) -> Option<NodeRetryPolicy>
Per-task retry policy. Default
None means “no retry — propagate
the error”. When Some, the engine retries execute on retryable
errors with exponential backoff.Auto Trait Implementations§
impl<S, F> Freeze for NodeFn<S, F>where
F: Freeze,
impl<S, F> RefUnwindSafe for NodeFn<S, F>where
F: RefUnwindSafe,
impl<S, F> Send for NodeFn<S, F>where
F: Send,
impl<S, F> Sync for NodeFn<S, F>where
F: Sync,
impl<S, F> Unpin for NodeFn<S, F>where
F: Unpin,
impl<S, F> UnsafeUnpin for NodeFn<S, F>where
F: UnsafeUnpin,
impl<S, F> UnwindSafe for NodeFn<S, F>where
F: UnwindSafe,
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