pub trait Cache: Send + Sync {
// Required methods
fn get_snapshot(&self, node: NodeHash) -> Option<Arc<Snapshot>>;
fn set_snapshot(&self, node: NodeHash, snapshot: Snapshot);
fn clear_snapshot(&self, node: NodeHash);
fn snapshot_count(&self) -> usize;
}Expand description
Trait for xDS snapshot caches.
Provides the interface for storing and retrieving snapshots.
Required Methods§
Sourcefn set_snapshot(&self, node: NodeHash, snapshot: Snapshot)
fn set_snapshot(&self, node: NodeHash, snapshot: Snapshot)
Set a snapshot for a node.
This will notify any watches for this node.
Sourcefn clear_snapshot(&self, node: NodeHash)
fn clear_snapshot(&self, node: NodeHash)
Clear the snapshot for a node.
Sourcefn snapshot_count(&self) -> usize
fn snapshot_count(&self) -> usize
Get the number of cached snapshots.