pub struct AsyncFnRouter<S, F, Fut>where
S: GraphState,
F: Fn(&S) -> Fut + Send + Sync,
Fut: Future<Output = Result<RouteOutput>> + Send,{ /* private fields */ }Expand description
A router created from an async function.
Implementations§
Source§impl<S, F, Fut> AsyncFnRouter<S, F, Fut>where
S: GraphState,
F: Fn(&S) -> Fut + Send + Sync,
Fut: Future<Output = Result<RouteOutput>> + Send,
impl<S, F, Fut> AsyncFnRouter<S, F, Fut>where
S: GraphState,
F: Fn(&S) -> Fut + Send + Sync,
Fut: Future<Output = Result<RouteOutput>> + Send,
Trait Implementations§
Source§impl<S, F, Fut> EdgeRouter<S> for AsyncFnRouter<S, F, Fut>where
S: GraphState,
F: Fn(&S) -> Fut + Send + Sync,
Fut: Future<Output = Result<RouteOutput>> + Send,
impl<S, F, Fut> EdgeRouter<S> for AsyncFnRouter<S, F, Fut>where
S: GraphState,
F: Fn(&S) -> Fut + Send + Sync,
Fut: Future<Output = Result<RouteOutput>> + Send,
Source§fn route<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 S,
) -> Pin<Box<dyn Future<Output = Result<RouteOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn route<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 S,
) -> Pin<Box<dyn Future<Output = Result<RouteOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Determine the next node(s) based on the current state.
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Get a description of this router (for debugging).
Auto Trait Implementations§
impl<S, F, Fut> Freeze for AsyncFnRouter<S, F, Fut>
impl<S, F, Fut> RefUnwindSafe for AsyncFnRouter<S, F, Fut>
impl<S, F, Fut> Send for AsyncFnRouter<S, F, Fut>
impl<S, F, Fut> Sync for AsyncFnRouter<S, F, Fut>
impl<S, F, Fut> Unpin for AsyncFnRouter<S, F, Fut>
impl<S, F, Fut> UnsafeUnpin for AsyncFnRouter<S, F, Fut>
impl<S, F, Fut> UnwindSafe for AsyncFnRouter<S, F, Fut>
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