pub struct AgentContextBuilder { /* private fields */ }Expand description
Fluent builder for AgentContext that allows populating optional topology
and lineage fields before stamping the context at construction time.
Obtain one via AgentContext::builder().
Implementations§
Source§impl AgentContextBuilder
impl AgentContextBuilder
Sourcepub fn parent_agent_id(self, id: AgentId) -> Self
pub fn parent_agent_id(self, id: AgentId) -> Self
Set the agent that spawned this one.
Sourcepub fn delegation_reason(self, r: String) -> Self
pub fn delegation_reason(self, r: String) -> Self
Set the human-readable reason the parent delegated to this agent.
Sourcepub fn spawned_by_tool(self, t: String) -> Self
pub fn spawned_by_tool(self, t: String) -> Self
Set the tool or framework that triggered the spawn.
Sourcepub fn root_agent_id(self, id: AgentId) -> Self
pub fn root_agent_id(self, id: AgentId) -> Self
Set the root agent of the delegation chain.
Source§impl AgentContextBuilder
impl AgentContextBuilder
Sourcepub fn build(
self,
agent_id: AgentId,
session_id: SessionId,
pid: u32,
) -> AgentContext
pub fn build( self, agent_id: AgentId, session_id: SessionId, pid: u32, ) -> AgentContext
Consume the builder and construct an AgentContext stamped at the
current wall-clock time. metadata is initialised empty.
Auto Trait Implementations§
impl Freeze for AgentContextBuilder
impl RefUnwindSafe for AgentContextBuilder
impl Send for AgentContextBuilder
impl Sync for AgentContextBuilder
impl Unpin for AgentContextBuilder
impl UnsafeUnpin for AgentContextBuilder
impl UnwindSafe for AgentContextBuilder
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