pub struct AgentEffect {
pub facts: Vec<Fact>,
pub proposals: Vec<ProposedFact>,
}Expand description
The output of an agent’s execution.
Effects are:
- Immutable once created
- Self-contained
- Merged serially by the engine
Fields§
§facts: Vec<Fact>New facts to add to context.
proposals: Vec<ProposedFact>New proposals to be validated by the engine.
Implementations§
Source§impl AgentEffect
impl AgentEffect
Sourcepub fn with_facts(facts: Vec<Fact>) -> Self
pub fn with_facts(facts: Vec<Fact>) -> Self
Creates an effect with multiple facts.
Sourcepub fn with_proposal(proposal: ProposedFact) -> Self
pub fn with_proposal(proposal: ProposedFact) -> Self
Creates an effect with a single proposal.
Sourcepub fn affected_keys(&self) -> Vec<ContextKey>
pub fn affected_keys(&self) -> Vec<ContextKey>
Returns the context keys affected by this effect.
Used by the engine to determine which agents to re-evaluate after merging this effect (dependency-indexed eligibility).
Trait Implementations§
Source§impl Debug for AgentEffect
impl Debug for AgentEffect
Source§impl Default for AgentEffect
impl Default for AgentEffect
Source§fn default() -> AgentEffect
fn default() -> AgentEffect
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AgentEffect
impl RefUnwindSafe for AgentEffect
impl Send for AgentEffect
impl Sync for AgentEffect
impl Unpin for AgentEffect
impl UnwindSafe for AgentEffect
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