pub enum Description {
Node {
base: DescriptionBase,
},
Flow {
base: DescriptionBase,
nodes: Vec<Description>,
edges: Vec<Edge>,
},
}Expand description
Represents a description of either a single Node or an entire flow of connected nodes.
This enum is primarily used for introspection and visualization of a flow.
Variants§
Node
Single node description.
Fields
base: DescriptionBaseThe base description containing type information and metadata.
Flow
Description of a flow.
Flow description is a collection of nodes connected by edges. It’s used for describing composite node structures and pipelines.
Fields
base: DescriptionBaseThe base description containing type information and metadata.
nodes: Vec<Description>The collection of node descriptions that make up this flow.
Implementations§
Source§impl Description
impl Description
Sourcepub fn new_node<NodeType, Input, Output, Error, Context>(
node: &NodeType,
) -> Selfwhere
NodeType: Node<Input, NodeOutput<Output>, Error, Context>,
pub fn new_node<NodeType, Input, Output, Error, Context>(
node: &NodeType,
) -> Selfwhere
NodeType: Node<Input, NodeOutput<Output>, Error, Context>,
Creates a new Description::Node from a given Node instance.
Sourcepub fn new_flow<NodeType, Input, Output, Error, Context>(
node: &NodeType,
nodes: Vec<Self>,
edges: Vec<Edge>,
) -> Selfwhere
NodeType: Node<Input, NodeOutput<Output>, Error, Context>,
pub fn new_flow<NodeType, Input, Output, Error, Context>(
node: &NodeType,
nodes: Vec<Self>,
edges: Vec<Edge>,
) -> Selfwhere
NodeType: Node<Input, NodeOutput<Output>, Error, Context>,
Creates a new Description::Flow from a given Node instance.
§Parameters
node: The flow-level node.nodes: The list of contained node descriptions.edges: The connections between nodes.
Sourcepub const fn get_base_mut(&mut self) -> &mut DescriptionBase
pub const fn get_base_mut(&mut self) -> &mut DescriptionBase
Returns a mutable reference to the underlying DescriptionBase.
Sourcepub const fn get_base_ref(&self) -> &DescriptionBase
pub const fn get_base_ref(&self) -> &DescriptionBase
Returns an immutable reference to the underlying DescriptionBase.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets a description on this node or flow.
This is primarily used to provide additional documentation or context.
Sourcepub fn with_externals(self, externals: Vec<ExternalResource>) -> Self
pub fn with_externals(self, externals: Vec<ExternalResource>) -> Self
Sets the external resources used by this node or flow.
External resources could include remote calls, file accesses or other types of external services.
Sourcepub fn modify_name(self, func: impl FnOnce(&mut String)) -> Self
pub fn modify_name(self, func: impl FnOnce(&mut String)) -> Self
Modifies the name using a provided function.
This is useful when you only want to modify the name.
Trait Implementations§
Source§impl Clone for Description
impl Clone for Description
Source§fn clone(&self) -> Description
fn clone(&self) -> Description
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more