Struct zarrs::storage::StorageHandle
source · pub struct StorageHandle<TStorage: ?Sized>(/* private fields */);
Expand description
A storage handle.
This is a handle to borrowed storage which can be owned and cloned, even if the storage it references is unsized.
Implementations§
Trait Implementations§
source§impl<TStorage: ?Sized + AsyncListableStorageTraits> AsyncListableStorageTraits for StorageHandle<TStorage>
Available on crate feature async
only.
impl<TStorage: ?Sized + AsyncListableStorageTraits> AsyncListableStorageTraits for StorageHandle<TStorage>
Available on crate feature
async
only.source§fn list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<StoreKeys, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<StoreKeys, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
source§fn list_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<StoreKeys, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<StoreKeys, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<StoreKeysPrefixes, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<StoreKeysPrefixes, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§impl<TStorage: ?Sized + AsyncReadableStorageTraits> AsyncReadableStorageTraits for StorageHandle<TStorage>
Available on crate feature async
only.
impl<TStorage: ?Sized + AsyncReadableStorageTraits> AsyncReadableStorageTraits for StorageHandle<TStorage>
Available on crate feature
async
only.source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<MaybeBytes, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<MaybeBytes, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn get_partial_values_key<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey,
byte_ranges: &'life2 [ByteRange]
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Vec<u8>>>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_partial_values_key<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey,
byte_ranges: &'life2 [ByteRange]
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Vec<u8>>>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve partial bytes from a list of byte ranges for a store key. Read more
source§fn get_partial_values<'life0, 'life1, 'async_trait>(
&'life0 self,
key_ranges: &'life1 [StoreKeyRange]
) -> Pin<Box<dyn Future<Output = Result<Vec<MaybeBytes>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_partial_values<'life0, 'life1, 'async_trait>(
&'life0 self,
key_ranges: &'life1 [StoreKeyRange]
) -> Pin<Box<dyn Future<Output = Result<Vec<MaybeBytes>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve partial bytes from a list of
StoreKeyRange
. Read moresource§fn size_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn size_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the size in bytes of all keys under
prefix
. Read moresource§fn size_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn size_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the size in bytes of the value at
key
. Read moresource§fn size<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn size<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the size in bytes of the readable storage. Read more
source§fn get_partial_values_batched_by_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_ranges: &'life1 [StoreKeyRange]
) -> Pin<Box<dyn Future<Output = Result<Vec<MaybeBytes>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_partial_values_batched_by_key<'life0, 'life1, 'async_trait>(
&'life0 self,
key_ranges: &'life1 [StoreKeyRange]
) -> Pin<Box<dyn Future<Output = Result<Vec<MaybeBytes>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
A utility method with the same input and output as
get_partial_values
that internally calls get_partial_values_key
with byte ranges grouped by key. Read moresource§impl<TStorage: ?Sized + AsyncWritableStorageTraits> AsyncWritableStorageTraits for StorageHandle<TStorage>
Available on crate feature async
only.
impl<TStorage: ?Sized + AsyncWritableStorageTraits> AsyncWritableStorageTraits for StorageHandle<TStorage>
Available on crate feature
async
only.source§fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey,
value: Bytes
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey,
value: Bytes
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn set_partial_values<'life0, 'life1, 'async_trait>(
&'life0 self,
key_start_values: &'life1 [StoreKeyStartValue<'_>]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_partial_values<'life0, 'life1, 'async_trait>(
&'life0 self,
key_start_values: &'life1 [StoreKeyStartValue<'_>]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store bytes according to a list of
StoreKeyStartValue
. Read moresource§fn erase<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn erase<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn erase_values<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StoreKey]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn erase_values<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StoreKey]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn erase_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn erase_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§impl<TStorage: Clone + ?Sized> Clone for StorageHandle<TStorage>
impl<TStorage: Clone + ?Sized> Clone for StorageHandle<TStorage>
source§fn clone(&self) -> StorageHandle<TStorage>
fn clone(&self) -> StorageHandle<TStorage>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<TStorage: ?Sized + ListableStorageTraits> ListableStorageTraits for StorageHandle<TStorage>
impl<TStorage: ?Sized + ListableStorageTraits> ListableStorageTraits for StorageHandle<TStorage>
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§impl<TStorage: ?Sized + ReadableStorageTraits> ReadableStorageTraits for StorageHandle<TStorage>
impl<TStorage: ?Sized + ReadableStorageTraits> ReadableStorageTraits for StorageHandle<TStorage>
source§fn get(&self, key: &StoreKey) -> Result<MaybeBytes, StorageError>
fn get(&self, key: &StoreKey) -> Result<MaybeBytes, StorageError>
source§fn get_partial_values_key(
&self,
key: &StoreKey,
byte_ranges: &[ByteRange]
) -> Result<Option<Vec<Vec<u8>>>, StorageError>
fn get_partial_values_key( &self, key: &StoreKey, byte_ranges: &[ByteRange] ) -> Result<Option<Vec<Vec<u8>>>, StorageError>
Retrieve partial bytes from a list of byte ranges for a store key. Read more
source§fn get_partial_values(
&self,
key_ranges: &[StoreKeyRange]
) -> Result<Vec<MaybeBytes>, StorageError>
fn get_partial_values( &self, key_ranges: &[StoreKeyRange] ) -> Result<Vec<MaybeBytes>, StorageError>
Retrieve partial bytes from a list of
StoreKeyRange
. Read moresource§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§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 get_partial_values_batched_by_key(
&self,
key_ranges: &[StoreKeyRange]
) -> Result<Vec<MaybeBytes>, StorageError>
fn get_partial_values_batched_by_key( &self, key_ranges: &[StoreKeyRange] ) -> Result<Vec<MaybeBytes>, StorageError>
A utility method with the same input and output as
get_partial_values
that internally calls get_partial_values_key
with byte ranges grouped by key. Read moresource§impl<TStorage: ?Sized + WritableStorageTraits> WritableStorageTraits for StorageHandle<TStorage>
impl<TStorage: ?Sized + WritableStorageTraits> WritableStorageTraits for StorageHandle<TStorage>
source§fn set_partial_values(
&self,
key_start_values: &[StoreKeyStartValue<'_>]
) -> Result<(), StorageError>
fn set_partial_values( &self, key_start_values: &[StoreKeyStartValue<'_>] ) -> Result<(), StorageError>
Store bytes according to a list of
StoreKeyStartValue
. Read moresource§fn erase_values(&self, keys: &[StoreKey]) -> Result<(), StorageError>
fn erase_values(&self, keys: &[StoreKey]) -> Result<(), StorageError>
source§fn erase_prefix(&self, prefix: &StorePrefix) -> Result<(), StorageError>
fn erase_prefix(&self, prefix: &StorePrefix) -> Result<(), StorageError>
impl<TStorage: ?Sized + AsyncReadableWritableStorageTraits> AsyncReadableWritableStorageTraits for StorageHandle<TStorage>
Available on crate feature
async
only.impl<TStorage: ?Sized + ReadableWritableStorageTraits> ReadableWritableStorageTraits for StorageHandle<TStorage>
Auto Trait Implementations§
impl<TStorage> Freeze for StorageHandle<TStorage>where
TStorage: ?Sized,
impl<TStorage> RefUnwindSafe for StorageHandle<TStorage>where
TStorage: RefUnwindSafe + ?Sized,
impl<TStorage> Send for StorageHandle<TStorage>
impl<TStorage> Sync for StorageHandle<TStorage>
impl<TStorage> Unpin for StorageHandle<TStorage>where
TStorage: ?Sized,
impl<TStorage> UnwindSafe for StorageHandle<TStorage>where
TStorage: RefUnwindSafe + ?Sized,
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