pub struct AgentCard {
pub display_name: String,
pub agent_id: String,
pub machine_id: String,
pub user_id: Option<String>,
pub addresses: Vec<String>,
pub groups: Vec<CardGroup>,
pub stores: Vec<CardStore>,
pub created_at: u64,
pub dm_capabilities: Option<DmCapabilities>,
}Expand description
A shareable identity card for an x0x agent.
Contains everything someone needs to find and trust you on the network.
Fields§
§display_name: StringHuman-readable display name (e.g., “David”, “alice-bot”).
agent_id: StringAgent ID (hex-encoded, 64 chars).
machine_id: StringMachine ID (hex-encoded, 64 chars). The ant-quic raw public key hash.
user_id: Option<String>User ID (hex-encoded, 64 chars). Only present if the agent has a human identity and chose to include it.
addresses: Vec<String>Network addresses where this agent can be reached (IP:port). May be empty if the agent hasn’t announced yet.
groups: Vec<CardGroup>Groups this agent belongs to, with invite links. Allows one-click “add me AND join my groups”.
stores: Vec<CardStore>KvStore topics this agent wants to share.
created_at: u64Unix seconds when this card was generated.
dm_capabilities: Option<DmCapabilities>Direct-messaging transport capabilities advertised by this agent.
Added in x0x 0.18 (C — DM over gossip). Cards predating 0.18 carry
None, interpreted by senders as “raw-QUIC / legacy only”.
Implementations§
Source§impl AgentCard
impl AgentCard
Sourcepub fn new(display_name: String, agent_id: &AgentId, machine_id: &str) -> Self
pub fn new(display_name: String, agent_id: &AgentId, machine_id: &str) -> Self
Create a new agent card.
Sourcepub fn to_link(&self) -> String
pub fn to_link(&self) -> String
Encode this card as a shareable link.
Format: x0x://agent/<base64url(json)>
Sourcepub fn from_link(link: &str) -> Result<Self, String>
pub fn from_link(link: &str) -> Result<Self, String>
Parse a card from a link string.
Accepts x0x://agent/<base64> or raw base64.
§Errors
Returns an error if the link is malformed.
Sourcepub fn short_display(&self) -> String
pub fn short_display(&self) -> String
Get a short display string for this card.
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>,
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
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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