pub struct CachedAgentCard {
pub card: AgentCard,
pub card_json: Vec<u8>,
pub etag: String,
pub last_modified: DateTime<Utc>,
}Available on crate features
a2a-v1 and server only.Expand description
Cached agent card with ETag, Last-Modified, and pre-serialized JSON.
Fields§
§card: AgentCardThe agent card.
card_json: Vec<u8>Pre-serialized card JSON bytes.
etag: StringDeterministic hash of the serialized card JSON, used as ETag.
last_modified: DateTime<Utc>Timestamp of the last card change.
Implementations§
Source§impl CachedAgentCard
impl CachedAgentCard
Sourcepub fn new(card: AgentCard) -> CachedAgentCard
pub fn new(card: AgentCard) -> CachedAgentCard
Creates a new cached agent card, computing the ETag and serialized JSON.
Sourcepub fn matches_etag(&self, if_none_match: &str) -> bool
pub fn matches_etag(&self, if_none_match: &str) -> bool
Returns true if the given If-None-Match value matches the current ETag.
Supports both quoted ("abc123") and unquoted (abc123) ETag values.
Sourcepub fn modified_since(&self, if_modified_since: &DateTime<Utc>) -> bool
pub fn modified_since(&self, if_modified_since: &DateTime<Utc>) -> bool
Returns true if the card was modified after the given timestamp.
Trait Implementations§
Source§impl Clone for CachedAgentCard
impl Clone for CachedAgentCard
Source§fn clone(&self) -> CachedAgentCard
fn clone(&self) -> CachedAgentCard
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 CachedAgentCard
impl RefUnwindSafe for CachedAgentCard
impl Send for CachedAgentCard
impl Sync for CachedAgentCard
impl Unpin for CachedAgentCard
impl UnsafeUnpin for CachedAgentCard
impl UnwindSafe for CachedAgentCard
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