pub struct AsyncMemoryBlobStore { /* private fields */ }
Expand description
Asynchronous in-memory blob store
Implementations§
Source§impl AsyncMemoryBlobStore
impl AsyncMemoryBlobStore
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create with initial capacity
Trait Implementations§
Source§impl AsyncBlobStore for AsyncMemoryBlobStore
impl AsyncBlobStore for AsyncMemoryBlobStore
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<RecordId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<RecordId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store a blob and return its record ID
Source§fn get<'life0, 'async_trait>(
&'life0 self,
id: RecordId,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
id: RecordId,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve a blob by its record ID
Source§fn remove<'life0, 'async_trait>(
&'life0 self,
id: RecordId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove<'life0, 'async_trait>(
&'life0 self,
id: RecordId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove a blob by its record ID
Source§fn contains<'life0, 'async_trait>(
&'life0 self,
id: RecordId,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn contains<'life0, 'async_trait>(
&'life0 self,
id: RecordId,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if a blob exists
Source§fn size<'life0, 'async_trait>(
&'life0 self,
id: RecordId,
) -> Pin<Box<dyn Future<Output = Result<Option<usize>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn size<'life0, 'async_trait>(
&'life0 self,
id: RecordId,
) -> Pin<Box<dyn Future<Output = Result<Option<usize>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the size of a blob without loading it
Source§fn len<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn len<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the number of blobs in the store
Source§fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Flush any pending writes
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BlobStoreStats> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BlobStoreStats> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get store statistics
Source§fn put_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Vec<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<Vec<RecordId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Vec<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<Vec<RecordId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Batch operations for better performance
fn get_batch<'life0, 'async_trait>(
&'life0 self,
ids: Vec<RecordId>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for AsyncMemoryBlobStore
impl !RefUnwindSafe for AsyncMemoryBlobStore
impl Send for AsyncMemoryBlobStore
impl Sync for AsyncMemoryBlobStore
impl Unpin for AsyncMemoryBlobStore
impl !UnwindSafe for AsyncMemoryBlobStore
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> 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