pub struct AgentInfo {
pub agent_id: String,
pub agent_type: AgentType,
pub capabilities: AgentCapabilities,
pub chosen_transport: Option<String>,
pub registered_at: u64,
pub last_seen: u64,
pub transport: AgentTransport,
pub metadata: Map<String, Value>,
}Expand description
Complete agent information
Fields§
§agent_id: StringUnique agent identifier
agent_type: AgentTypeAgent type (sensory, motor, or both)
capabilities: AgentCapabilitiesAgent capabilities
chosen_transport: Option<String>Transport method the agent chose to use
registered_at: u64Registration timestamp (Unix epoch milliseconds)
last_seen: u64Last activity timestamp (Unix epoch milliseconds)
transport: AgentTransportTransport mechanism
metadata: Map<String, Value>Metadata (client version, hostname, etc.)
Implementations§
Source§impl AgentInfo
impl AgentInfo
Sourcepub fn new(
agent_id: String,
agent_type: AgentType,
capabilities: AgentCapabilities,
transport: AgentTransport,
) -> Self
pub fn new( agent_id: String, agent_type: AgentType, capabilities: AgentCapabilities, transport: AgentTransport, ) -> Self
Create a new agent info with current timestamp
Sourcepub fn update_activity(&mut self)
pub fn update_activity(&mut self)
Update last_seen timestamp to current time
Sourcepub fn is_inactive(&self, timeout_ms: u64) -> bool
pub fn is_inactive(&self, timeout_ms: u64) -> bool
Check if agent has been inactive for more than timeout_ms
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentInfo
impl<'de> Deserialize<'de> for AgentInfo
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentInfo
impl RefUnwindSafe for AgentInfo
impl Send for AgentInfo
impl Sync for AgentInfo
impl Unpin for AgentInfo
impl UnsafeUnpin for AgentInfo
impl UnwindSafe for AgentInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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