pub struct NodeDoc {
pub id: String,
pub kind: String,
pub title: Option<String>,
pub parent: Option<String>,
pub policy: NodePolicy,
pub config: Map<String, Value>,
pub strict: bool,
}Expand description
One node. Node-specific settings live in config.
Serializes to the flat layout the loader accepts (id, type, title,
parent, on_error, retry, timeout_ms, then the config keys), so a
document survives a serialize / parse round trip unchanged.
Fields§
§id: String§kind: StringNode kind, e.g. llm, if-else, http-request.
title: Option<String>§parent: Option<String>Owning container (iteration / loop) for nodes inside a container body.
policy: NodePolicy§config: Map<String, Value>Remaining node-specific configuration.
strict: boolWhether unknown config fields are errors (judged by the node kind’s catalog schema). True for v1 documents and programmatic nodes; false for nodes read from the import layout, which carry foreign builder fields.
Implementations§
Source§impl NodeDoc
impl NodeDoc
Sourcepub fn new(
id: impl Into<String>,
kind: impl Into<String>,
config: Value,
) -> Self
pub fn new( id: impl Into<String>, kind: impl Into<String>, config: Value, ) -> Self
Minimal constructor, mainly for programmatic graph building and tests.
Sourcepub fn with_parent(self, parent: impl Into<String>) -> Self
pub fn with_parent(self, parent: impl Into<String>) -> Self
Set the owning container.
Sourcepub fn with_policy(self, policy: NodePolicy) -> Self
pub fn with_policy(self, policy: NodePolicy) -> Self
Set the failure policy.
Sourcepub fn parse_config<T: DeserializeOwned>(&self) -> Result<T, DocumentError>
pub fn parse_config<T: DeserializeOwned>(&self) -> Result<T, DocumentError>
Deserialize config into a node-specific config struct.