pub struct AgentIdentity {
pub agent_id: String,
pub public_key: Vec<u8>,
pub created_at: u64,
pub expires_at: Option<u64>,
pub roles: Vec<String>,
pub metadata: HashMap<String, String>,
}Expand description
An agent’s cryptographic identity.
Fields§
§agent_id: String§public_key: Vec<u8>§created_at: u64§expires_at: Option<u64>§roles: Vec<String>§metadata: HashMap<String, String>Implementations§
Source§impl AgentIdentity
impl AgentIdentity
pub fn new(agent_id: &str, public_key: Vec<u8>) -> Self
pub fn with_role(self, role: &str) -> Self
pub fn with_expiry(self, ts: u64) -> Self
pub fn is_expired(&self, now: u64) -> bool
pub fn has_role(&self, role: &str) -> bool
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Simple key fingerprint (hex of first 8 bytes).
Trait Implementations§
Source§impl Clone for AgentIdentity
impl Clone for AgentIdentity
Source§fn clone(&self) -> AgentIdentity
fn clone(&self) -> AgentIdentity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AgentIdentity
impl RefUnwindSafe for AgentIdentity
impl Send for AgentIdentity
impl Sync for AgentIdentity
impl Unpin for AgentIdentity
impl UnsafeUnpin for AgentIdentity
impl UnwindSafe for AgentIdentity
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