pub struct TrackedStore<S> { /* private fields */ }Expand description
Storage adapter that tracks bytes read from disk.
Wraps an inner storage and accumulates byte counts into shared stats.
Implementations§
Source§impl<S> TrackedStore<S>
impl<S> TrackedStore<S>
Sourcepub fn new(inner: Arc<S>, stats: SharedIoStats) -> Self
pub fn new(inner: Arc<S>, stats: SharedIoStats) -> Self
Create a new tracked store wrapping the given storage.
Trait Implementations§
Source§impl<S: Debug> Debug for TrackedStore<S>
impl<S: Debug> Debug for TrackedStore<S>
Source§impl<S: ListableStorageTraits> ListableStorageTraits for TrackedStore<S>
impl<S: ListableStorageTraits> ListableStorageTraits for TrackedStore<S>
Source§fn list_prefix(&self, prefix: &StorePrefix) -> Result<StoreKeys, StorageError>
fn list_prefix(&self, prefix: &StorePrefix) -> Result<StoreKeys, StorageError>
Source§fn list_dir(
&self,
prefix: &StorePrefix,
) -> Result<StoreKeysPrefixes, StorageError>
fn list_dir( &self, prefix: &StorePrefix, ) -> Result<StoreKeysPrefixes, StorageError>
Source§fn size(&self) -> Result<u64, StorageError>
fn size(&self) -> Result<u64, StorageError>
Return the total size in bytes of the storage. Read more
Source§fn size_prefix(&self, prefix: &StorePrefix) -> Result<u64, StorageError>
fn size_prefix(&self, prefix: &StorePrefix) -> Result<u64, StorageError>
Return the size in bytes of all keys under
prefix. Read moreSource§impl<S: ReadableStorageTraits> ReadableStorageTraits for TrackedStore<S>
impl<S: ReadableStorageTraits> ReadableStorageTraits for TrackedStore<S>
Source§fn get(&self, key: &StoreKey) -> Result<MaybeBytes, StorageError>
fn get(&self, key: &StoreKey) -> Result<MaybeBytes, StorageError>
Source§fn get_partial_many<'a>(
&'a self,
key: &StoreKey,
byte_ranges: ByteRangeIterator<'a>,
) -> Result<MaybeBytesIterator<'a>, StorageError>
fn get_partial_many<'a>( &'a self, key: &StoreKey, byte_ranges: ByteRangeIterator<'a>, ) -> Result<MaybeBytesIterator<'a>, StorageError>
Retrieve partial bytes from a list of byte ranges for a store key. Read more
Source§fn size_key(&self, key: &StoreKey) -> Result<Option<u64>, StorageError>
fn size_key(&self, key: &StoreKey) -> Result<Option<u64>, StorageError>
Return the size in bytes of the value at
key. Read moreSource§fn supports_get_partial(&self) -> bool
fn supports_get_partial(&self) -> bool
Returns whether this store supports partial reads. Read more
Source§fn get_partial(
&self,
key: &StoreKey,
byte_range: ByteRange,
) -> Result<Option<Bytes>, StorageError>
fn get_partial( &self, key: &StoreKey, byte_range: ByteRange, ) -> Result<Option<Bytes>, StorageError>
Retrieve partial bytes from a single byte range for a store key. Read more
Auto Trait Implementations§
impl<S> Freeze for TrackedStore<S>
impl<S> RefUnwindSafe for TrackedStore<S>where
S: RefUnwindSafe,
impl<S> Send for TrackedStore<S>
impl<S> Sync for TrackedStore<S>
impl<S> Unpin for TrackedStore<S>
impl<S> UnwindSafe for TrackedStore<S>where
S: RefUnwindSafe,
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more