pub struct NodeConfig {
pub id: NodeId,
pub name: String,
pub description: Option<String>,
pub input_mappings: HashMap<String, String>,
pub output_mappings: HashMap<String, String>,
pub config: Value,
pub retryable: bool,
pub max_retries: usize,
pub tags: Vec<String>,
}Expand description
Base configuration for all node types
Fields§
§id: NodeIdNode ID
name: StringDisplay name
description: Option<String>Optional description
input_mappings: HashMap<String, String>Input key mappings (state_key -> node_input_key)
output_mappings: HashMap<String, String>Output key mappings (node_output_key -> state_key)
config: ValueNode-specific configuration
retryable: boolWhether this node can be retried on failure
max_retries: usizeMaximum number of retry attempts
Tags for organizing and filtering nodes
Implementations§
Source§impl NodeConfig
impl NodeConfig
Sourcepub fn new(id: impl Into<NodeId>, name: impl Into<String>) -> Self
pub fn new(id: impl Into<NodeId>, name: impl Into<String>) -> Self
Create a new node configuration
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description
Sourcepub fn with_input_mapping(
self,
state_key: impl Into<String>,
node_input_key: impl Into<String>,
) -> Self
pub fn with_input_mapping( self, state_key: impl Into<String>, node_input_key: impl Into<String>, ) -> Self
Add an input mapping
Sourcepub fn with_output_mapping(
self,
node_output_key: impl Into<String>,
state_key: impl Into<String>,
) -> Self
pub fn with_output_mapping( self, node_output_key: impl Into<String>, state_key: impl Into<String>, ) -> Self
Add an output mapping
Sourcepub fn with_config(self, config: Value) -> Self
pub fn with_config(self, config: Value) -> Self
Set the configuration
Sourcepub fn with_retries(self, max_retries: usize) -> Self
pub fn with_retries(self, max_retries: usize) -> Self
Make the node retryable
Add tags
Trait Implementations§
Source§impl Clone for NodeConfig
impl Clone for NodeConfig
Source§fn clone(&self) -> NodeConfig
fn clone(&self) -> NodeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeConfig
impl Debug for NodeConfig
Source§impl<'de> Deserialize<'de> for NodeConfig
impl<'de> Deserialize<'de> for NodeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NodeConfig
impl RefUnwindSafe for NodeConfig
impl Send for NodeConfig
impl Sync for NodeConfig
impl Unpin for NodeConfig
impl UnwindSafe for NodeConfig
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