Skip to main content

SubgraphNode

Struct SubgraphNode 

Source
pub struct SubgraphNode<S: StateSchema, SubS: StateSchema> { /* private fields */ }
Expand description

Subgraph Node - A node that executes a nested compiled graph

This allows composition of graphs by embedding one graph inside another. The subgraph receives mapped input state and returns mapped output state.

Implementations§

Source§

impl<S: StateSchema, SubS: StateSchema> SubgraphNode<S, SubS>

Source

pub fn new( name: impl Into<String>, subgraph: CompiledGraph<SubS>, input_mapper: impl Fn(&S) -> SubS + Send + Sync + 'static, output_mapper: impl Fn(&SubS, &mut S) + Send + Sync + 'static, ) -> Self

Source§

impl<S: StateSchema + Clone> SubgraphNode<S, S>

Source

pub fn same_state(name: impl Into<String>, subgraph: CompiledGraph<S>) -> Self

Trait Implementations§

Source§

impl<S: StateSchema + 'static, SubS: StateSchema + 'static> GraphNode<S> for SubgraphNode<S, SubS>

Source§

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, state: &'life1 S, _config: Option<NodeConfig>, ) -> Pin<Box<dyn Future<Output = NodeResult<S>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute the node Read more
Source§

fn name(&self) -> &str

Get node name

Auto Trait Implementations§

§

impl<S, SubS> !RefUnwindSafe for SubgraphNode<S, SubS>

§

impl<S, SubS> !UnwindSafe for SubgraphNode<S, SubS>

§

impl<S, SubS> Freeze for SubgraphNode<S, SubS>
where CompiledGraph<SubS>: Freeze, Arc<dyn Fn(&S) -> SubS + Send + Sync>: Freeze, Arc<dyn Fn(&SubS, &mut S) + Send + Sync>: Freeze, PhantomData<S>: Freeze, PhantomData<SubS>: Freeze,

§

impl<S, SubS> Send for SubgraphNode<S, SubS>
where CompiledGraph<SubS>: Send, Arc<dyn Fn(&S) -> SubS + Send + Sync>: Send, Arc<dyn Fn(&SubS, &mut S) + Send + Sync>: Send, PhantomData<S>: Send, PhantomData<SubS>: Send,

§

impl<S, SubS> Sync for SubgraphNode<S, SubS>
where CompiledGraph<SubS>: Sync, Arc<dyn Fn(&S) -> SubS + Send + Sync>: Sync, Arc<dyn Fn(&SubS, &mut S) + Send + Sync>: Sync, PhantomData<S>: Sync, PhantomData<SubS>: Sync,

§

impl<S, SubS> Unpin for SubgraphNode<S, SubS>
where CompiledGraph<SubS>: Unpin, Arc<dyn Fn(&S) -> SubS + Send + Sync>: Unpin, Arc<dyn Fn(&SubS, &mut S) + Send + Sync>: Unpin, PhantomData<S>: Unpin, PhantomData<SubS>: Unpin,

§

impl<S, SubS> UnsafeUnpin for SubgraphNode<S, SubS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.