Struct zarrs::array::codec::array_to_bytes::sharding::ShardingCodec
source · pub struct ShardingCodec { /* private fields */ }
Available on crate feature
sharding
only.Expand description
A sharding
codec implementation.
Implementations§
source§impl ShardingCodec
impl ShardingCodec
sourcepub fn new(
chunk_shape: ChunkShape,
inner_codecs: CodecChain,
index_codecs: CodecChain,
index_location: ShardingIndexLocation,
) -> Self
pub fn new( chunk_shape: ChunkShape, inner_codecs: CodecChain, index_codecs: CodecChain, index_location: ShardingIndexLocation, ) -> Self
Create a new sharding
codec.
sourcepub fn new_with_configuration(
configuration: &ShardingCodecConfiguration,
) -> Result<Self, PluginCreateError>
pub fn new_with_configuration( configuration: &ShardingCodecConfiguration, ) -> Result<Self, PluginCreateError>
Create a new sharding
codec from configuration.
§Errors
Returns PluginCreateError
if there is a configuration issue.
Trait Implementations§
source§impl ArrayCodecTraits for ShardingCodec
impl ArrayCodecTraits for ShardingCodec
source§fn recommended_concurrency(
&self,
decoded_representation: &ChunkRepresentation,
) -> Result<RecommendedConcurrency, CodecError>
fn recommended_concurrency( &self, decoded_representation: &ChunkRepresentation, ) -> Result<RecommendedConcurrency, CodecError>
Return the recommended concurrency for the requested decoded representation. Read more
source§fn partial_decode_granularity(
&self,
_decoded_representation: &ChunkRepresentation,
) -> ChunkShape
fn partial_decode_granularity( &self, _decoded_representation: &ChunkRepresentation, ) -> ChunkShape
Return the partial decode granularity. Read more
source§impl ArrayToBytesCodecTraits for ShardingCodec
impl ArrayToBytesCodecTraits for ShardingCodec
source§fn encode<'a>(
&self,
bytes: ArrayBytes<'a>,
shard_rep: &ChunkRepresentation,
options: &CodecOptions,
) -> Result<RawBytes<'a>, CodecError>
fn encode<'a>( &self, bytes: ArrayBytes<'a>, shard_rep: &ChunkRepresentation, options: &CodecOptions, ) -> Result<RawBytes<'a>, CodecError>
Encode a chunk. Read more
source§fn decode<'a>(
&self,
encoded_shard: RawBytes<'a>,
shard_representation: &ChunkRepresentation,
options: &CodecOptions,
) -> Result<ArrayBytes<'a>, CodecError>
fn decode<'a>( &self, encoded_shard: RawBytes<'a>, shard_representation: &ChunkRepresentation, options: &CodecOptions, ) -> Result<ArrayBytes<'a>, CodecError>
Decode a chunk. Read more
source§fn partial_decoder<'a>(
&'a self,
input_handle: Box<dyn BytesPartialDecoderTraits + 'a>,
decoded_representation: &ChunkRepresentation,
options: &CodecOptions,
) -> Result<Box<dyn ArrayPartialDecoderTraits + 'a>, CodecError>
fn partial_decoder<'a>( &'a self, input_handle: Box<dyn BytesPartialDecoderTraits + 'a>, decoded_representation: &ChunkRepresentation, options: &CodecOptions, ) -> Result<Box<dyn ArrayPartialDecoderTraits + 'a>, CodecError>
Initialise a partial decoder. Read more
source§fn async_partial_decoder<'a, 'life0, 'life1, 'async_trait>(
&'a self,
input_handle: Box<dyn AsyncBytesPartialDecoderTraits + 'a>,
decoded_representation: &'life0 ChunkRepresentation,
options: &'life1 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncArrayPartialDecoderTraits + 'a>, CodecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn async_partial_decoder<'a, 'life0, 'life1, 'async_trait>(
&'a self,
input_handle: Box<dyn AsyncBytesPartialDecoderTraits + 'a>,
decoded_representation: &'life0 ChunkRepresentation,
options: &'life1 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncArrayPartialDecoderTraits + 'a>, CodecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Available on crate feature
async
only.Initialise an asynchronous partial decoder. Read more
source§fn compute_encoded_size(
&self,
decoded_representation: &ChunkRepresentation,
) -> Result<BytesRepresentation, CodecError>
fn compute_encoded_size( &self, decoded_representation: &ChunkRepresentation, ) -> Result<BytesRepresentation, CodecError>
Returns the size of the encoded representation given a size of the decoded representation. Read more
source§impl Clone for ShardingCodec
impl Clone for ShardingCodec
source§fn clone(&self) -> ShardingCodec
fn clone(&self) -> ShardingCodec
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 CodecTraits for ShardingCodec
impl CodecTraits for ShardingCodec
source§fn create_metadata_opt(
&self,
_options: &ArrayMetadataOptions,
) -> Option<MetadataV3>
fn create_metadata_opt( &self, _options: &ArrayMetadataOptions, ) -> Option<MetadataV3>
Create metadata. Read more
source§fn partial_decoder_should_cache_input(&self) -> bool
fn partial_decoder_should_cache_input(&self) -> bool
Indicates if the input to a codecs partial decoder should be cached for optimal performance.
If true, a cache may be inserted before it in a
CodecChain
partial decoder.source§fn partial_decoder_decodes_all(&self) -> bool
fn partial_decoder_decodes_all(&self) -> bool
Indicates if a partial decoder decodes all bytes from its input handle and its output should be cached for optimal performance.
If true, a cache will be inserted at some point after it in a
CodecChain
partial decoder.source§fn create_metadata(&self) -> Option<MetadataV3>
fn create_metadata(&self) -> Option<MetadataV3>
Create metadata with default options. Read more
Auto Trait Implementations§
impl Freeze for ShardingCodec
impl !RefUnwindSafe for ShardingCodec
impl Send for ShardingCodec
impl Sync for ShardingCodec
impl Unpin for ShardingCodec
impl !UnwindSafe for ShardingCodec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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