Skip to main content

AsyncArrayShardedReadableExt

Trait AsyncArrayShardedReadableExt 

Source
pub trait AsyncArrayShardedReadableExt<TStorage: ?Sized + AsyncReadableStorageTraits + 'static>: Sealed {
    // Required methods
    fn async_subchunk_byte_range<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        subchunk_indices: &'life2 [u64],
    ) -> Pin<Box<dyn Future<Output = Result<Option<ByteRange>, ArrayError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn async_retrieve_encoded_subchunk<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        subchunk_indices: &'life2 [u64],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ArrayError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn async_retrieve_subchunk_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        subchunk_indices: &'life2 [u64],
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<T, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + FromArrayBytes + MaybeSend,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn async_retrieve_subchunk_elements_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        subchunk_indices: &'life2 [u64],
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn async_retrieve_subchunk_ndarray_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        subchunk_indices: &'life2 [u64],
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<ArrayD<T>, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn async_retrieve_subchunks_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        subchunks: &'life2 dyn ArraySubsetTraits,
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<T, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + FromArrayBytes + MaybeSend,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn async_retrieve_subchunks_elements_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        subchunks: &'life2 dyn ArraySubsetTraits,
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn async_retrieve_subchunks_ndarray_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        subchunks: &'life2 dyn ArraySubsetTraits,
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<ArrayD<T>, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn async_retrieve_array_subset_sharded_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        array_subset: &'life2 dyn ArraySubsetTraits,
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<T, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + FromArrayBytes + MaybeSend,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn async_retrieve_array_subset_elements_sharded_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        array_subset: &'life2 dyn ArraySubsetTraits,
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn async_retrieve_array_subset_ndarray_sharded_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        cache: &'life1 AsyncArrayShardedReadableExtCache,
        array_subset: &'life2 dyn ArraySubsetTraits,
        options: &'life3 CodecOptions,
    ) -> Pin<Box<dyn Future<Output = Result<ArrayD<T>, ArrayError>> + Send + 'async_trait>>
       where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Available on crate features sharding and async only.
Expand description

An Array extension trait to efficiently read data (e.g. subchunks) from arrays using the sharding_indexed codec. s Sharding indexes are cached in a AsyncArrayShardedReadableExtCache enabling faster retrieval.

Required Methodsยง

Source

fn async_subchunk_byte_range<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, subchunk_indices: &'life2 [u64], ) -> Pin<Box<dyn Future<Output = Result<Option<ByteRange>, ArrayError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieve the byte range of an encoded subchunk.

ยงErrors

Returns an ArrayError on failure, such as if decoding the shard index fails.

Source

fn async_retrieve_encoded_subchunk<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, subchunk_indices: &'life2 [u64], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ArrayError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieve the encoded bytes of a subchunk.

See Array::retrieve_encoded_chunk.

Source

fn async_retrieve_subchunk_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, subchunk_indices: &'life2 [u64], options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<T, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + FromArrayBytes + MaybeSend, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Read and decode the subchunk at subchunk_indices into its bytes.

See Array::retrieve_chunk_opt.

Source

fn async_retrieve_subchunk_elements_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, subchunk_indices: &'life2 [u64], options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated since 0.23.0:

Use async_retrieve_subchunk_opt::<Vec<T>>() instead

Read and decode the subchunk at subchunk_indices into a vector of its elements.

See Array::retrieve_chunk_elements_opt.

Source

fn async_retrieve_subchunk_ndarray_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, subchunk_indices: &'life2 [u64], options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<ArrayD<T>, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated since 0.23.0:

Use async_retrieve_subchunk_opt::<ndarray::ArrayD<T>>() instead

Available on crate feature ndarray only.

Read and decode the subchunk at subchunk_indices into an ndarray::ArrayD.

See Array::retrieve_chunk_ndarray_opt.

Source

fn async_retrieve_subchunks_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, subchunks: &'life2 dyn ArraySubsetTraits, options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<T, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + FromArrayBytes + MaybeSend, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Read and decode the chunks at chunks.

See Array::retrieve_chunks_opt.

Source

fn async_retrieve_subchunks_elements_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, subchunks: &'life2 dyn ArraySubsetTraits, options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated since 0.23.0:

Use async_retrieve_subchunks_opt::<Vec<T>>() instead

Read and decode the subchunks at subchunks into a vector of their elements.

See Array::retrieve_chunks_elements_opt.

Source

fn async_retrieve_subchunks_ndarray_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, subchunks: &'life2 dyn ArraySubsetTraits, options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<ArrayD<T>, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated since 0.23.0:

Use async_retrieve_subchunks_opt::<ndarray::ArrayD<T>>() instead

Available on crate feature ndarray only.

Read and decode the subchunks at subchunks into an ndarray::ArrayD.

See Array::retrieve_chunks_ndarray_opt.

Source

fn async_retrieve_array_subset_sharded_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, array_subset: &'life2 dyn ArraySubsetTraits, options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<T, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + FromArrayBytes + MaybeSend, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Read and decode the array_subset of array.

See Array::retrieve_array_subset_opt.

Source

fn async_retrieve_array_subset_elements_sharded_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, array_subset: &'life2 dyn ArraySubsetTraits, options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated since 0.23.0:

Use async_retrieve_array_subset_sharded_opt::<Vec<T>>() instead

Read and decode the array_subset of array into a vector of its elements.

See Array::retrieve_array_subset_elements_opt.

Source

fn async_retrieve_array_subset_ndarray_sharded_opt<'life0, 'life1, 'life2, 'life3, 'async_trait, T>( &'life0 self, cache: &'life1 AsyncArrayShardedReadableExtCache, array_subset: &'life2 dyn ArraySubsetTraits, options: &'life3 CodecOptions, ) -> Pin<Box<dyn Future<Output = Result<ArrayD<T>, ArrayError>> + Send + 'async_trait>>
where T: 'async_trait + ElementOwned + MaybeSend + MaybeSync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

๐Ÿ‘ŽDeprecated since 0.23.0:

Use async_retrieve_array_subset_sharded_opt::<ndarray::ArrayD<T>>() instead

Available on crate feature ndarray only.

Read and decode the array_subset of array into an ndarray::ArrayD.

See Array::retrieve_array_subset_ndarray_opt.

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementorsยง

Sourceยง

impl<TStorage: ?Sized + AsyncReadableStorageTraits + 'static> AsyncArrayShardedReadableExt<TStorage> for Array<TStorage>