pub struct Instrumented<'a, B> { /* private fields */ }Expand description
A BlobBackend that counts what the wrapped backend does, per operation. It changes nothing.
Implementations§
Trait Implementations§
Source§impl<B: BlobBackend> BlobBackend for Instrumented<'_, B>
impl<B: BlobBackend> BlobBackend for Instrumented<'_, B>
Source§async fn read(&self, key: &str) -> Result<Option<Vec<u8>>, BlobError>
async fn read(&self, key: &str) -> Result<Option<Vec<u8>>, BlobError>
The value at
key, or None if absent.Source§async fn write(&self, key: &str, bytes: Vec<u8>) -> Result<(), BlobError>
async fn write(&self, key: &str, bytes: Vec<u8>) -> Result<(), BlobError>
Store
bytes at key, replacing any earlier value. Atomicity is not implied; that is
blob.replace_atomic.Source§async fn delete(&self, key: &str) -> Result<(), BlobError>
async fn delete(&self, key: &str) -> Result<(), BlobError>
Remove
key. Removing an absent key is Ok.Source§async fn stat(&self, key: &str) -> Result<Option<Entry>, BlobError>
async fn stat(&self, key: &str) -> Result<Option<Entry>, BlobError>
The entry at
key without reading its value, or None if absent.Source§async fn list(
&self,
prefix: &str,
after: Option<&str>,
limit: usize,
) -> Result<Page, BlobError>
async fn list( &self, prefix: &str, after: Option<&str>, limit: usize, ) -> Result<Page, BlobError>
Up to
limit entries whose key starts with the literal prefix, in ascending bytewise
key order, strictly after after if given.Source§async fn create_exclusive(
&self,
key: &str,
bytes: Vec<u8>,
) -> Result<bool, BlobError>
async fn create_exclusive( &self, key: &str, bytes: Vec<u8>, ) -> Result<bool, BlobError>
Write
bytes at key only if nothing is there. Ok(true) created it, Ok(false) found
a value and changed nothing. Of any number of concurrent callers for one key, exactly one
gets Ok(true) (blob.create_exclusive). A backend that cannot promise that returns
BlobError::Unsupported; the default does.Source§async fn replace_atomic(
&self,
key: &str,
bytes: Vec<u8>,
) -> Result<(), BlobError>
async fn replace_atomic( &self, key: &str, bytes: Vec<u8>, ) -> Result<(), BlobError>
Replace the value at
key so that a concurrent reader sees the whole old value or the
whole new one, never a mix (blob.replace_atomic.concurrent_read). A backend that cannot
promise that returns BlobError::Unsupported; the default does.Source§async fn append(&self, key: &str, bytes: Vec<u8>) -> Result<(), BlobError>
async fn append(&self, key: &str, bytes: Vec<u8>) -> Result<(), BlobError>
Add
bytes after the existing bytes of key, in call order (blob.append). Of
concurrent calls, each call’s bytes arrive whole and exactly once
(blob.append.concurrent_whole). A backend that cannot promise that returns
BlobError::Unsupported; the default does.Auto Trait Implementations§
impl<'a, B> !Freeze for Instrumented<'a, B>
impl<'a, B> RefUnwindSafe for Instrumented<'a, B>where
&'a B: RefUnwindSafe,
impl<'a, B> Send for Instrumented<'a, B>
impl<'a, B> Sync for Instrumented<'a, B>
impl<'a, B> Unpin for Instrumented<'a, B>
impl<'a, B> UnsafeUnpin for Instrumented<'a, B>where
&'a B: UnsafeUnpin,
impl<'a, B> UnwindSafe for Instrumented<'a, B>where
&'a B: UnwindSafe,
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