pub struct ParentCommand<S: State> {
pub command: Command<S>,
pub source_node: String,
pub namespace: String,
}Expand description
Command wrapper for subgraph-to-parent communication
This wrapper is used as an exception mechanism for subgraph nodes to send commands to their parent graph, along with metadata about the source node and namespace.
§Type Parameters
S- The parent graph’s state type
§Fields
command- The command to send to the parent graphsource_node- The name of the subgraph node sending this command (for debugging and logging)namespace- The subgraph namespace for routing purposes
Fields§
§command: Command<S>The command to send to the parent graph
source_node: StringSource node information (for debugging and logging)
namespace: StringSubgraph namespace (for routing)
Implementations§
Source§impl<S: State> ParentCommand<S>
impl<S: State> ParentCommand<S>
Sourcepub fn from_subgraph(
command: Command<S>,
source_node: &str,
namespace: &str,
) -> Self
pub fn from_subgraph( command: Command<S>, source_node: &str, namespace: &str, ) -> Self
Create a new ParentCommand from a subgraph
§Arguments
command- The command to send to the parent graphsource_node- The name of the subgraph node sending this commandnamespace- The subgraph namespace for routing
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for ParentCommand<S>
impl<S> RefUnwindSafe for ParentCommand<S>
impl<S> Send for ParentCommand<S>
impl<S> Sync for ParentCommand<S>
impl<S> Unpin for ParentCommand<S>
impl<S> UnsafeUnpin for ParentCommand<S>
impl<S> UnwindSafe for ParentCommand<S>
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