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>,
}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.
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.
Trait Implementations§
Auto Trait Implementations§
impl Forget for NodeDoc
impl Freeze for NodeDoc
impl Move for NodeDoc
impl RefUnwindSafe for NodeDoc
impl Send for NodeDoc
impl Sync for NodeDoc
impl Unpin for NodeDoc
impl UnsafeUnpin for NodeDoc
impl UnwindSafe for NodeDoc
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