pub struct BaseNode { /* private fields */ }Expand description
The identity, configuration and schemas shared by every node kind. Custom node types hold a
BaseNode and delegate the Node metadata methods to it.
Implementations§
Source§impl BaseNode
impl BaseNode
Sourcepub fn with_schemas(
name: &str,
description: &str,
input: Option<Value>,
output: Option<Value>,
cfg: NodeConfig,
) -> Result<Self, WorkflowError>
pub fn with_schemas( name: &str, description: &str, input: Option<Value>, output: Option<Value>, cfg: NodeConfig, ) -> Result<Self, WorkflowError>
A BaseNode with the given identity, configuration, and JSON schemas. Fails when a schema
does not compile.
Sourcepub fn new(name: &str, description: &str, cfg: NodeConfig) -> Self
pub fn new(name: &str, description: &str, cfg: NodeConfig) -> Self
A BaseNode with no schemas.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
The node’s human-readable description.
Sourcepub fn config(&self) -> &NodeConfig
pub fn config(&self) -> &NodeConfig
The node’s configuration.
Sourcepub fn input_schema(&self) -> Option<&Value>
pub fn input_schema(&self) -> Option<&Value>
The node’s input validation schema.
Sourcepub fn output_schema(&self) -> Option<&Value>
pub fn output_schema(&self) -> Option<&Value>
The node’s output validation schema.
Sourcepub fn validate_input(&self, v: Value) -> Result<Value, WorkflowError>
pub fn validate_input(&self, v: Value) -> Result<Value, WorkflowError>
Validates and coerces the input using the node’s input schema. The error message is the raw validator text.
Sourcepub fn validate_output(&self, v: Value) -> Result<Value, WorkflowError>
pub fn validate_output(&self, v: Value) -> Result<Value, WorkflowError>
Validates the output against the node’s output schema. The error message is the raw validator text.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BaseNode
impl !UnwindSafe for BaseNode
impl Forget for BaseNode
impl Freeze for BaseNodewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<dyn Fn(&AgentError) -> bool + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&AgentError) -> bool + Sync + Send>>: Freeze,
*const ArcInner<CompiledSchema> is !null: Freeze,
PhantomData<ArcInner<CompiledSchema>>: Freeze,
impl Move for BaseNode
impl Send for BaseNode
impl Sync for BaseNode
impl Unpin for BaseNode
impl UnsafeUnpin for BaseNodewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<dyn Fn(&AgentError) -> bool + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&AgentError) -> bool + Sync + Send>>: UnsafeUnpin,
*const ArcInner<CompiledSchema> is !null: UnsafeUnpin,
PhantomData<ArcInner<CompiledSchema>>: UnsafeUnpin,
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