Skip to main content

Cache

Trait Cache 

Source
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§

Source

fn get_snapshot(&self, node: NodeHash) -> Option<Arc<Snapshot>>

Get a snapshot for a node.

Source

fn set_snapshot(&self, node: NodeHash, snapshot: Snapshot)

Set a snapshot for a node.

This will notify any watches for this node.

Source

fn clear_snapshot(&self, node: NodeHash)

Clear the snapshot for a node.

Source

fn snapshot_count(&self) -> usize

Get the number of cached snapshots.

Implementors§