pub trait ChunkCache: MaybeSend + MaybeSync {
Show 19 methods
// Required methods
fn array(&self) -> Arc<Array<dyn ReadableStorageTraits>>;
fn retrieve_chunk_bytes(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<ChunkCacheTypeDecoded, ArrayError>;
fn retrieve_chunk_subset_bytes(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ChunkCacheTypeDecoded, ArrayError>;
fn len(&self) -> usize;
// Provided methods
fn retrieve_chunk<T: FromArrayBytes>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<T, ArrayError>
where Self: Sized { ... }
fn retrieve_chunk_elements<T: ElementOwned>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>
where Self: Sized { ... }
fn retrieve_chunk_ndarray<T: ElementOwned>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>
where Self: Sized { ... }
fn retrieve_chunk_subset<T: FromArrayBytes>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>
where Self: Sized { ... }
fn retrieve_chunk_subset_elements<T: ElementOwned>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>
where Self: Sized { ... }
fn retrieve_chunk_subset_ndarray<T: ElementOwned>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>
where Self: Sized { ... }
fn retrieve_array_subset_bytes(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ChunkCacheTypeDecoded, ArrayError> { ... }
fn retrieve_array_subset<T: FromArrayBytes>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>
where Self: Sized { ... }
fn retrieve_array_subset_elements<T: ElementOwned>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>
where Self: Sized { ... }
fn retrieve_array_subset_ndarray<T: ElementOwned>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>
where Self: Sized { ... }
fn retrieve_chunks_bytes(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ChunkCacheTypeDecoded, ArrayError> { ... }
fn retrieve_chunks<T: FromArrayBytes>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>
where Self: Sized { ... }
fn retrieve_chunks_elements<T: ElementOwned>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>
where Self: Sized { ... }
fn retrieve_chunks_ndarray<T: ElementOwned>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>
where Self: Sized { ... }
fn is_empty(&self) -> bool { ... }
}Expand description
Traits for a chunk cache.
Required Methods§
Sourcefn array(&self) -> Arc<Array<dyn ReadableStorageTraits>>
fn array(&self) -> Arc<Array<dyn ReadableStorageTraits>>
Return the array associated with the chunk cache.
Sourcefn retrieve_chunk_bytes(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<ChunkCacheTypeDecoded, ArrayError>
fn retrieve_chunk_bytes( &self, chunk_indices: &[u64], options: &CodecOptions, ) -> Result<ChunkCacheTypeDecoded, ArrayError>
Cached variant of retrieve_chunk_opt returning the cached bytes.
Sourcefn retrieve_chunk_subset_bytes(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ChunkCacheTypeDecoded, ArrayError>
fn retrieve_chunk_subset_bytes( &self, chunk_indices: &[u64], chunk_subset: &dyn ArraySubsetTraits, options: &CodecOptions, ) -> Result<ChunkCacheTypeDecoded, ArrayError>
Cached variant of retrieve_chunk_subset_opt returning the cached bytes.
Provided Methods§
Sourcefn retrieve_chunk<T: FromArrayBytes>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<T, ArrayError>where
Self: Sized,
fn retrieve_chunk<T: FromArrayBytes>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<T, ArrayError>where
Self: Sized,
Cached variant of retrieve_chunk_opt.
Sourcefn retrieve_chunk_elements<T: ElementOwned>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>where
Self: Sized,
👎Deprecated since 0.23.0: Use retrieve_chunk::<Vec<T>>() instead
fn retrieve_chunk_elements<T: ElementOwned>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>where
Self: Sized,
Cached variant of retrieve_chunk_elements_opt.
Sourcefn retrieve_chunk_ndarray<T: ElementOwned>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>where
Self: Sized,
👎Deprecated since 0.23.0: Use retrieve_chunk::<ndarray::ArrayD<T>>() insteadAvailable on crate feature ndarray only.
fn retrieve_chunk_ndarray<T: ElementOwned>(
&self,
chunk_indices: &[u64],
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>where
Self: Sized,
ndarray only.Cached variant of retrieve_chunk_ndarray_opt.
Sourcefn retrieve_chunk_subset<T: FromArrayBytes>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>where
Self: Sized,
fn retrieve_chunk_subset<T: FromArrayBytes>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>where
Self: Sized,
Cached variant of retrieve_chunk_subset_opt.
Sourcefn retrieve_chunk_subset_elements<T: ElementOwned>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>where
Self: Sized,
👎Deprecated since 0.23.0: Use retrieve_chunk_subset::<Vec<T>>() instead
fn retrieve_chunk_subset_elements<T: ElementOwned>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>where
Self: Sized,
Cached variant of retrieve_chunk_subset_elements_opt.
Sourcefn retrieve_chunk_subset_ndarray<T: ElementOwned>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>where
Self: Sized,
👎Deprecated since 0.23.0: Use retrieve_chunk_subset::<ndarray::ArrayD<T>>() insteadAvailable on crate feature ndarray only.
fn retrieve_chunk_subset_ndarray<T: ElementOwned>(
&self,
chunk_indices: &[u64],
chunk_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>where
Self: Sized,
ndarray only.Cached variant of retrieve_chunk_subset_ndarray_opt.
Sourcefn retrieve_array_subset_bytes(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ChunkCacheTypeDecoded, ArrayError>
fn retrieve_array_subset_bytes( &self, array_subset: &dyn ArraySubsetTraits, options: &CodecOptions, ) -> Result<ChunkCacheTypeDecoded, ArrayError>
Cached variant of retrieve_array_subset_opt returning the cached bytes.
Sourcefn retrieve_array_subset<T: FromArrayBytes>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>where
Self: Sized,
fn retrieve_array_subset<T: FromArrayBytes>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>where
Self: Sized,
Cached variant of retrieve_array_subset_opt.
Sourcefn retrieve_array_subset_elements<T: ElementOwned>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>where
Self: Sized,
👎Deprecated since 0.23.0: Use retrieve_array_subset::<Vec<T>>() instead
fn retrieve_array_subset_elements<T: ElementOwned>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>where
Self: Sized,
Cached variant of retrieve_array_subset_elements_opt.
Sourcefn retrieve_array_subset_ndarray<T: ElementOwned>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>where
Self: Sized,
👎Deprecated since 0.23.0: Use retrieve_array_subset::<ndarray::ArrayD<T>>() insteadAvailable on crate feature ndarray only.
fn retrieve_array_subset_ndarray<T: ElementOwned>(
&self,
array_subset: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>where
Self: Sized,
ndarray only.Cached variant of retrieve_array_subset_ndarray_opt.
Sourcefn retrieve_chunks_bytes(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ChunkCacheTypeDecoded, ArrayError>
fn retrieve_chunks_bytes( &self, chunks: &dyn ArraySubsetTraits, options: &CodecOptions, ) -> Result<ChunkCacheTypeDecoded, ArrayError>
Cached variant of retrieve_chunks_opt returning the cached bytes.
Sourcefn retrieve_chunks<T: FromArrayBytes>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>where
Self: Sized,
fn retrieve_chunks<T: FromArrayBytes>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<T, ArrayError>where
Self: Sized,
Cached variant of retrieve_chunks_opt.
Sourcefn retrieve_chunks_elements<T: ElementOwned>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>where
Self: Sized,
👎Deprecated since 0.23.0: Use retrieve_chunks::<Vec<T>>() instead
fn retrieve_chunks_elements<T: ElementOwned>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<Vec<T>, ArrayError>where
Self: Sized,
Cached variant of retrieve_chunks_elements_opt.
Sourcefn retrieve_chunks_ndarray<T: ElementOwned>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>where
Self: Sized,
👎Deprecated since 0.23.0: Use retrieve_chunks::<ndarray::ArrayD<T>>() insteadAvailable on crate feature ndarray only.
fn retrieve_chunks_ndarray<T: ElementOwned>(
&self,
chunks: &dyn ArraySubsetTraits,
options: &CodecOptions,
) -> Result<ArrayD<T>, ArrayError>where
Self: Sized,
ndarray only.Cached variant of retrieve_chunks_ndarray_opt.