pub struct AgentRoster {
pub agents: BTreeMap<String, RosterAgent>,
}Expand description
The agent roster — a collection of agents available for orchestration.
Fields§
§agents: BTreeMap<String, RosterAgent>Implementations§
Source§impl AgentRoster
impl AgentRoster
Sourcepub fn register(&mut self, agent: RosterAgent)
pub fn register(&mut self, agent: RosterAgent)
Insert or replace an agent keyed by its id.
Sourcepub fn unregister(&mut self, agent_id: &str) -> bool
pub fn unregister(&mut self, agent_id: &str) -> bool
Remove an agent by id; true when one was present.
Sourcepub fn get(&self, agent_id: &str) -> Option<&RosterAgent>
pub fn get(&self, agent_id: &str) -> Option<&RosterAgent>
Look up an agent by id.
Sourcepub fn all_capabilities(&self) -> Vec<String>
pub fn all_capabilities(&self) -> Vec<String>
Sorted, de-duplicated capabilities across all active agents.
Sourcepub fn active_agents(&self) -> Vec<&RosterAgent>
pub fn active_agents(&self) -> Vec<&RosterAgent>
All agents currently marked active.
Sourcepub fn find_agent_for_capability(&self, cap: &str) -> Option<&RosterAgent>
pub fn find_agent_for_capability(&self, cap: &str) -> Option<&RosterAgent>
First active agent advertising cap (BTreeMap id order).
Trait Implementations§
Source§impl Clone for AgentRoster
impl Clone for AgentRoster
Source§impl Debug for AgentRoster
impl Debug for AgentRoster
Auto Trait Implementations§
impl Freeze for AgentRoster
impl RefUnwindSafe for AgentRoster
impl Send for AgentRoster
impl Sync for AgentRoster
impl Unpin for AgentRoster
impl UnsafeUnpin for AgentRoster
impl UnwindSafe for AgentRoster
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.