pub struct AsyncFn<F, I, O, E = NodeError>where
F: for<'a> Fn(&'a I) -> Pin<Box<dyn Future<Output = Result<O, E>> + Send + 'a>> + Send + Sync + Clone + 'static,
E: Error + Send + Sync + 'static,{ /* private fields */ }Expand description
Wraps an asynchronous closure and exposes it as a TaskNode.
Implementations§
Trait Implementations§
Source§impl<F, I, O, E> TaskNode for AsyncFn<F, I, O, E>
impl<F, I, O, E> TaskNode for AsyncFn<F, I, O, E>
Source§fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_node_id: &'life1 NodeId<dyn TaskNode<Input = Self::Input, Output = Self::Output, Error = Self::Error>>,
input: &'life2 Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_node_id: &'life1 NodeId<dyn TaskNode<Input = Self::Input, Output = Self::Output, Error = Self::Error>>,
input: &'life2 Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Evaluates the node with the current input.
Auto Trait Implementations§
impl<F, I, O, E> Forget for AsyncFn<F, I, O, E>
impl<F, I, O, E> Freeze for AsyncFn<F, I, O, E>
impl<F, I, O, E> RefUnwindSafe for AsyncFn<F, I, O, E>
impl<F, I, O, E> Send for AsyncFn<F, I, O, E>
impl<F, I, O, E> Sync for AsyncFn<F, I, O, E>
impl<F, I, O, E> Unpin for AsyncFn<F, I, O, E>
impl<F, I, O, E> UnsafeUnpin for AsyncFn<F, I, O, E>
impl<F, I, O, E> UnwindSafe for AsyncFn<F, I, O, E>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more