pub trait StagerNotifier: Send + Sync {
// Required methods
fn on_cache_hit(&self, size: u64);
fn on_cache_miss(&self, size: u64);
fn on_cache_insert(&self, size: u64);
fn on_load_dir(&self, duration: Duration);
fn on_load_blob(&self, duration: Duration);
fn on_cache_evict(&self, size: u64);
fn on_recycle_insert(&self, size: u64);
fn on_recycle_clear(&self, size: u64);
}Expand description
StagerNotifier provides a way to notify the caller of the staging events.
Required Methods§
Sourcefn on_cache_hit(&self, size: u64)
fn on_cache_hit(&self, size: u64)
Notifies the caller that a cache hit occurred.
size is the size of the content that was hit in the cache.
Sourcefn on_cache_miss(&self, size: u64)
fn on_cache_miss(&self, size: u64)
Notifies the caller that a cache miss occurred.
size is the size of the content that was missed in the cache.
Sourcefn on_cache_insert(&self, size: u64)
fn on_cache_insert(&self, size: u64)
Notifies the caller that a blob or directory was inserted into the cache.
size is the size of the content that was inserted into the cache.
Note: not only cache misses will trigger this event, but recoveries and recycles as well.
Sourcefn on_load_dir(&self, duration: Duration)
fn on_load_dir(&self, duration: Duration)
Notifies the caller that a directory was inserted into the cache.
duration is the time it took to load the directory.
Sourcefn on_load_blob(&self, duration: Duration)
fn on_load_blob(&self, duration: Duration)
Notifies the caller that a blob was inserted into the cache.
duration is the time it took to load the blob.
Sourcefn on_cache_evict(&self, size: u64)
fn on_cache_evict(&self, size: u64)
Notifies the caller that a blob or directory was evicted from the cache.
size is the size of the content that was evicted from the cache.
Sourcefn on_recycle_insert(&self, size: u64)
fn on_recycle_insert(&self, size: u64)
Notifies the caller that a blob or directory was dropped to the recycle bin.
size is the size of the content that was dropped to the recycle bin.
Sourcefn on_recycle_clear(&self, size: u64)
fn on_recycle_clear(&self, size: u64)
Notifies the caller that the recycle bin was cleared.
size is the size of the content that was cleared from the recycle bin.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".