pub struct BranchNode {
pub id: String,
pub name: Option<String>,
pub on: Option<String>,
pub agent_hash: Option<String>,
pub cases: Vec<BranchCase>,
}Expand description
A branch node: routes on a typed output.
Fields§
§id: StringThe node’s stable id, unique within the document.
name: Option<String>Optional short display label for this node. See the module docs’ “The
optional node display name” section for the bound and the deliberate
hash-inclusion contrast with the agent name field. Additive: absent
on the wire when unset.
on: Option<String>Optional opaque reference to the typed value the branch routes on. Recorded as DATA; not resolved in this crate.
agent_hash: Option<String>Content hash of the agent that decides a BranchCondition::ModelDecision
case, in sha256:<64 lowercase hex> form. Present only on a branch that
carries a model-decision case: the engine drives this agent with the
routed value and maps its reply to a case name. Additive: absent on the
wire when unset, so a purely expression-driven branch (and every document
written before this field existed) serializes byte for byte as before.
[crate::validate] reports a model-decision case with no agent here as a
node-precise error.
cases: Vec<BranchCase>The cases, each a named condition. An expression condition is evaluated
against the routed value; a model-decision condition is resolved by the
node’s agent_hash agent. The first matching case in
author order wins, and the engine records the choice as a
crate::document-external BranchTaken event.
Trait Implementations§
Source§impl Clone for BranchNode
impl Clone for BranchNode
Source§fn clone(&self) -> BranchNode
fn clone(&self) -> BranchNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BranchNode
impl Debug for BranchNode
Source§impl<'de> Deserialize<'de> for BranchNode
impl<'de> Deserialize<'de> for BranchNode
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>,
Source§impl JsonSchema for BranchNode
impl JsonSchema for BranchNode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more