pub struct FnNode<S, F, Fut>where
S: State,
F: Fn(S) -> Fut + Send + Sync,
Fut: Future<Output = Result<NodeOutput<S>, SynapticError>> + Send,{ /* private fields */ }Expand description
Wraps an async function as a Node.
The function can return either NodeOutput<S> directly or S
(via Into<NodeOutput<S>>).
Implementations§
Trait Implementations§
Source§impl<S, F, Fut> Node<S> for FnNode<S, F, Fut>where
S: State,
F: Fn(S) -> Fut + Send + Sync,
Fut: Future<Output = Result<NodeOutput<S>, SynapticError>> + Send,
impl<S, F, Fut> Node<S> for FnNode<S, F, Fut>where
S: State,
F: Fn(S) -> Fut + Send + Sync,
Fut: Future<Output = Result<NodeOutput<S>, SynapticError>> + Send,
fn process<'life0, 'async_trait>(
&'life0 self,
state: S,
) -> Pin<Box<dyn Future<Output = Result<NodeOutput<S>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<S, F, Fut> Freeze for FnNode<S, F, Fut>where
F: Freeze,
impl<S, F, Fut> RefUnwindSafe for FnNode<S, F, Fut>where
F: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, F, Fut> Send for FnNode<S, F, Fut>
impl<S, F, Fut> Sync for FnNode<S, F, Fut>
impl<S, F, Fut> Unpin for FnNode<S, F, Fut>
impl<S, F, Fut> UnsafeUnpin for FnNode<S, F, Fut>where
F: UnsafeUnpin,
impl<S, F, Fut> UnwindSafe for FnNode<S, F, Fut>where
F: UnwindSafe,
S: 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