pub struct ObservableCs { /* private fields */ }Expand description
Wraps any ErasedContentStore with hit/miss/insert/eviction counters
and an optional CsObserver callback.
When no observer is registered, the overhead is a single Option check
plus an atomic increment per operation.
Implementations§
Source§impl ObservableCs
impl ObservableCs
pub fn new( inner: Arc<dyn ErasedContentStore>, observer: Option<Arc<dyn CsObserver>>, ) -> Self
Trait Implementations§
Source§impl ErasedContentStore for ObservableCs
impl ErasedContentStore for ObservableCs
fn get_erased<'a>( &'a self, interest: &'a Interest, ) -> Pin<Box<dyn Future<Output = Option<CsEntry>> + Send + 'a>>
fn insert_erased( &self, data: Bytes, name: Arc<Name>, meta: CsMeta, ) -> Pin<Box<dyn Future<Output = InsertResult> + Send + '_>>
fn evict_erased<'a>( &'a self, name: &'a Name, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'a>>
fn evict_prefix_erased<'a>( &'a self, prefix: &'a Name, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = usize> + Send + 'a>>
fn capacity(&self) -> CsCapacity
fn set_capacity(&self, max_bytes: usize)
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn current_bytes(&self) -> usize
fn variant_name(&self) -> &str
fn stats(&self) -> CsStats
Auto Trait Implementations§
impl !Freeze for ObservableCs
impl !RefUnwindSafe for ObservableCs
impl Send for ObservableCs
impl Sync for ObservableCs
impl Unpin for ObservableCs
impl !UnwindSafe for ObservableCs
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