pub struct SimpleLongRunningNode<Context, Action, State, Output, F>where
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
State: Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static,
Output: Send + Sync + 'static,
F: Fn(Option<State>, &mut Context) -> Result<LongRunningOutcome<Output, State>, FloxideError> + Send + Sync + 'static,{ /* private fields */ }Expand description
A simple long-running node that uses a closure for processing.
Implementations§
Source§impl<Context, Action, State, Output, F> SimpleLongRunningNode<Context, Action, State, Output, F>where
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
State: Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static,
Output: Send + Sync + 'static,
F: Fn(Option<State>, &mut Context) -> Result<LongRunningOutcome<Output, State>, FloxideError> + Send + Sync + 'static,
impl<Context, Action, State, Output, F> SimpleLongRunningNode<Context, Action, State, Output, F>where
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
State: Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static,
Output: Send + Sync + 'static,
F: Fn(Option<State>, &mut Context) -> Result<LongRunningOutcome<Output, State>, FloxideError> + Send + Sync + 'static,
Trait Implementations§
Source§impl<Context, Action, State, Output, F> LongRunningNode<Context, Action> for SimpleLongRunningNode<Context, Action, State, Output, F>where
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
State: Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static,
Output: Send + Sync + 'static,
F: Fn(Option<State>, &mut Context) -> Result<LongRunningOutcome<Output, State>, FloxideError> + Send + Sync + 'static,
impl<Context, Action, State, Output, F> LongRunningNode<Context, Action> for SimpleLongRunningNode<Context, Action, State, Output, F>where
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
State: Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static,
Output: Send + Sync + 'static,
F: Fn(Option<State>, &mut Context) -> Result<LongRunningOutcome<Output, State>, FloxideError> + Send + Sync + 'static,
Source§fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
state: Option<Self::State>,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<LongRunningOutcome<Self::Output, Self::State>, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
state: Option<Self::State>,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<LongRunningOutcome<Self::Output, Self::State>, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process the next step, potentially suspending execution
Auto Trait Implementations§
impl<Context, Action, State, Output, F> Freeze for SimpleLongRunningNode<Context, Action, State, Output, F>
impl<Context, Action, State, Output, F> RefUnwindSafe for SimpleLongRunningNode<Context, Action, State, Output, F>where
Context: RefUnwindSafe,
Action: RefUnwindSafe,
State: RefUnwindSafe,
Output: RefUnwindSafe,
F: RefUnwindSafe,
impl<Context, Action, State, Output, F> Send for SimpleLongRunningNode<Context, Action, State, Output, F>
impl<Context, Action, State, Output, F> Sync for SimpleLongRunningNode<Context, Action, State, Output, F>
impl<Context, Action, State, Output, F> Unpin for SimpleLongRunningNode<Context, Action, State, Output, F>
impl<Context, Action, State, Output, F> UnwindSafe for SimpleLongRunningNode<Context, Action, State, Output, F>where
F: RefUnwindSafe,
Context: UnwindSafe,
Action: UnwindSafe,
State: UnwindSafe,
Output: 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