pub struct AgentCard {
pub agent_id: AgentId,
pub name: String,
pub description: String,
pub capabilities: Vec<String>,
pub skills: Vec<String>,
pub endpoint: String,
pub status: AgentStatus,
}Expand description
A card describing an agent’s capabilities for discovery.
Each agent publishes an AgentCard to the registry, making its capabilities discoverable by other agents via A2A.
Fields§
§agent_id: AgentIdUnique identifier for this agent.
name: StringHuman-readable name of the agent.
description: StringDescription of what the agent does.
capabilities: Vec<String>List of capabilities (e.g., [“code-review”, “refactor”]).
skills: Vec<String>List of skills (e.g., [“rust”, “python”]).
endpoint: StringEndpoint for communication (e.g., “local”, “remote://…”).
status: AgentStatusCurrent status of the agent.
Implementations§
Source§impl AgentCard
impl AgentCard
Sourcepub fn new(
agent_id: AgentId,
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn new( agent_id: AgentId, name: impl Into<String>, description: impl Into<String>, ) -> Self
Creates a new agent card.
Sourcepub fn with_capability(self, capability: impl Into<String>) -> Self
pub fn with_capability(self, capability: impl Into<String>) -> Self
Adds a capability.
Sourcepub fn with_skill(self, skill: impl Into<String>) -> Self
pub fn with_skill(self, skill: impl Into<String>) -> Self
Adds a skill.
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
Sets the endpoint.
Sourcepub fn with_status(self, status: AgentStatus) -> Self
pub fn with_status(self, status: AgentStatus) -> Self
Sets the initial status.
Sourcepub fn has_capability(&self, capability: &str) -> bool
pub fn has_capability(&self, capability: &str) -> bool
Returns true if this agent has the given capability.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentCard
impl<'de> Deserialize<'de> for AgentCard
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 AgentCard
impl RefUnwindSafe for AgentCard
impl Send for AgentCard
impl Sync for AgentCard
impl Unpin for AgentCard
impl UnsafeUnpin for AgentCard
impl UnwindSafe for AgentCard
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