Handoff Chain • Rust AI Agent SDK

HandoffChain: Thread-safe handoff chain tracker.

HandoffChain

Defined in the handoff module.

Rust AI Agent SDK

Thread-safe handoff chain tracker.

Fields

NameTypeDescription
chainstd::sync::RwLock<Vec<String>>–

Methods

new

rust
fn new() -> Self

Create a new handoff chain

get

rust
fn get(&self) -> Vec<String>

Get current chain

depth

rust
fn depth(&self) -> usize

Get current depth

push

rust
fn push(&self, agent_name: impl Into<String>) -> ()

Push agent to chain

Parameters:

NameType
agent_nameimpl Into&lt;String&gt;

pop

rust
fn pop(&self) -> Option<String>

Pop agent from chain

contains

rust
fn contains(&self, agent_name: &str) -> bool

Check if agent is in chain (cycle detection)

Parameters:

NameType
agent_name&str

clear

rust
fn clear(&self) -> ()

Clear the chain

Source

View on GitHub

praisonai/src/handoff/mod.rs at line 442


Related Documentation