Skip to main content

ChunkCache

Trait ChunkCache 

Source
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§

Source

fn array(&self) -> Arc<Array<dyn ReadableStorageTraits>>

Return the array associated with the chunk cache.

Source

fn retrieve_chunk_bytes( &self, chunk_indices: &[u64], options: &CodecOptions, ) -> Result<ChunkCacheTypeDecoded, ArrayError>

Cached variant of retrieve_chunk_opt returning the cached bytes.

Source

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.

Source

fn len(&self) -> usize

Return the number of chunks in the cache. For a thread-local cache, returns the number of chunks cached on the current thread.

Provided Methods§

Source

fn retrieve_chunk<T: FromArrayBytes>( &self, chunk_indices: &[u64], options: &CodecOptions, ) -> Result<T, ArrayError>
where Self: Sized,

Cached variant of retrieve_chunk_opt.

Source

fn 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

Cached variant of retrieve_chunk_elements_opt.

Source

fn 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>>() instead
Available on crate feature ndarray only.

Cached variant of retrieve_chunk_ndarray_opt.

Source

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.

Source

fn 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
Source

fn 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>>() instead
Available on crate feature ndarray only.
Source

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.

Source

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.

Source

fn 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
Source

fn 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>>() instead
Available on crate feature ndarray only.
Source

fn retrieve_chunks_bytes( &self, chunks: &dyn ArraySubsetTraits, options: &CodecOptions, ) -> Result<ChunkCacheTypeDecoded, ArrayError>

Cached variant of retrieve_chunks_opt returning the cached bytes.

Source

fn retrieve_chunks<T: FromArrayBytes>( &self, chunks: &dyn ArraySubsetTraits, options: &CodecOptions, ) -> Result<T, ArrayError>
where Self: Sized,

Cached variant of retrieve_chunks_opt.

Source

fn 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

Cached variant of retrieve_chunks_elements_opt.

Source

fn 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>>() instead
Available on crate feature ndarray only.

Cached variant of retrieve_chunks_ndarray_opt.

Source

fn is_empty(&self) -> bool

Returns true if the cache is empty. For a thread-local cache, returns if the cache is empty on the current thread.

Implementors§