pub struct SubgraphBuilder<S: StateSchema, SubS: StateSchema> { /* private fields */ }Expand description
Builder for creating subgraph nodes with fluent API
Implementations§
Source§impl<S: StateSchema, SubS: StateSchema> SubgraphBuilder<S, SubS>
impl<S: StateSchema, SubS: StateSchema> SubgraphBuilder<S, SubS>
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Create a new subgraph builder with the given node name.
Sourcepub fn subgraph(self, graph: CompiledGraph<SubS>) -> Self
pub fn subgraph(self, graph: CompiledGraph<SubS>) -> Self
Set the compiled subgraph to execute.
Sourcepub fn input_mapper(
self,
mapper: impl Fn(&S) -> SubS + Send + Sync + 'static,
) -> Self
pub fn input_mapper( self, mapper: impl Fn(&S) -> SubS + Send + Sync + 'static, ) -> Self
Set the mapper from parent state to subgraph input.
Sourcepub fn output_mapper(
self,
mapper: impl Fn(&SubS, &mut S) + Send + Sync + 'static,
) -> Self
pub fn output_mapper( self, mapper: impl Fn(&SubS, &mut S) + Send + Sync + 'static, ) -> Self
Set the mapper from subgraph output back to parent state.
Sourcepub fn build(self) -> GraphResult<SubgraphNode<S, SubS>>
pub fn build(self) -> GraphResult<SubgraphNode<S, SubS>>
Build the SubgraphNode, failing if any required component is missing.
Auto Trait Implementations§
impl<S, SubS> !RefUnwindSafe for SubgraphBuilder<S, SubS>
impl<S, SubS> !UnwindSafe for SubgraphBuilder<S, SubS>
impl<S, SubS> Freeze for SubgraphBuilder<S, SubS>
impl<S, SubS> Send for SubgraphBuilder<S, SubS>
impl<S, SubS> Sync for SubgraphBuilder<S, SubS>
impl<S, SubS> Unpin for SubgraphBuilder<S, SubS>
impl<S, SubS> UnsafeUnpin for SubgraphBuilder<S, SubS>where
Option<CompiledGraph<SubS>>: UnsafeUnpin,
Option<Arc<dyn Fn(&S) -> SubS + Send + Sync>>: UnsafeUnpin,
Option<Arc<dyn Fn(&SubS, &mut S) + Send + Sync>>: UnsafeUnpin,
PhantomData<S>: UnsafeUnpin,
PhantomData<SubS>: UnsafeUnpin,
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