pub struct Snapshot { /* private fields */ }Expand description
An immutable snapshot of xDS resources for a node.
Snapshots are the primary unit of cache storage. Each snapshot contains resources organized by type, with per-type versioning.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn builder() -> SnapshotBuilder
pub fn builder() -> SnapshotBuilder
Create a new snapshot builder.
Sourcepub fn created_at(&self) -> Instant
pub fn created_at(&self) -> Instant
Get the creation timestamp.
Sourcepub fn get_resources(&self, type_url: TypeUrl) -> Option<&SnapshotResources>
pub fn get_resources(&self, type_url: TypeUrl) -> Option<&SnapshotResources>
Get resources for a specific type.
Sourcepub fn get_version(&self, type_url: TypeUrl) -> Option<&str>
pub fn get_version(&self, type_url: TypeUrl) -> Option<&str>
Get the version for a specific resource type.
Sourcepub fn contains_type(&self, type_url: TypeUrl) -> bool
pub fn contains_type(&self, type_url: TypeUrl) -> bool
Check if this snapshot contains a specific resource type.
Sourcepub fn type_urls(&self) -> impl Iterator<Item = &TypeUrl>
pub fn type_urls(&self) -> impl Iterator<Item = &TypeUrl>
Get all type URLs present in this snapshot.
Sourcepub fn total_resources(&self) -> usize
pub fn total_resources(&self) -> usize
Get the total number of resources across all types.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Snapshot
impl !RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl !UnwindSafe for Snapshot
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request