pub struct BytesCodec { /* private fields */ }Expand description
A bytes codec implementation.
Implementations§
Source§impl BytesCodec
impl BytesCodec
Sourcepub const fn new(endian: Option<Endianness>) -> Self
pub const fn new(endian: Option<Endianness>) -> Self
Create a new bytes codec.
endian is optional because an 8-bit type has no endianness.
Sourcepub fn new_with_configuration(
configuration: &BytesCodecConfiguration,
) -> Result<Self, PluginCreateError>
pub fn new_with_configuration( configuration: &BytesCodecConfiguration, ) -> Result<Self, PluginCreateError>
Create a new bytes codec from configuration.
§Errors
Returns an error if the configuration is not supported.
Trait Implementations§
Source§impl ArrayCodecTraits for BytesCodec
impl ArrayCodecTraits for BytesCodec
Source§fn recommended_concurrency(
&self,
_shape: &[NonZeroU64],
_data_type: &DataType,
) -> Result<RecommendedConcurrency, CodecError>
fn recommended_concurrency( &self, _shape: &[NonZeroU64], _data_type: &DataType, ) -> Result<RecommendedConcurrency, CodecError>
Return the recommended concurrency for the requested decoded representation. Read more
Source§impl ArrayToBytesCodecTraits for BytesCodec
impl ArrayToBytesCodecTraits for BytesCodec
Source§fn into_dyn(self: Arc<Self>) -> Arc<dyn ArrayToBytesCodecTraits>
fn into_dyn(self: Arc<Self>) -> Arc<dyn ArrayToBytesCodecTraits>
Return a dynamic version of the codec.
Source§fn encode<'a>(
&self,
bytes: ArrayBytes<'a>,
shape: &[NonZeroU64],
data_type: &DataType,
_fill_value: &FillValue,
_options: &CodecOptions,
) -> Result<ArrayBytesRaw<'a>, CodecError>
fn encode<'a>( &self, bytes: ArrayBytes<'a>, shape: &[NonZeroU64], data_type: &DataType, _fill_value: &FillValue, _options: &CodecOptions, ) -> Result<ArrayBytesRaw<'a>, CodecError>
Encode a chunk. Read more
Source§fn decode<'a>(
&self,
bytes: ArrayBytesRaw<'a>,
shape: &[NonZeroU64],
data_type: &DataType,
_fill_value: &FillValue,
_options: &CodecOptions,
) -> Result<ArrayBytes<'a>, CodecError>
fn decode<'a>( &self, bytes: ArrayBytesRaw<'a>, shape: &[NonZeroU64], data_type: &DataType, _fill_value: &FillValue, _options: &CodecOptions, ) -> Result<ArrayBytes<'a>, CodecError>
Decode a chunk. Read more
Source§fn partial_decoder(
self: Arc<Self>,
input_handle: Arc<dyn BytesPartialDecoderTraits>,
shape: &[NonZeroU64],
data_type: &DataType,
fill_value: &FillValue,
_options: &CodecOptions,
) -> Result<Arc<dyn ArrayPartialDecoderTraits>, CodecError>
fn partial_decoder( self: Arc<Self>, input_handle: Arc<dyn BytesPartialDecoderTraits>, shape: &[NonZeroU64], data_type: &DataType, fill_value: &FillValue, _options: &CodecOptions, ) -> Result<Arc<dyn ArrayPartialDecoderTraits>, CodecError>
Initialise a partial decoder. Read more
Source§fn partial_encoder(
self: Arc<Self>,
input_output_handle: Arc<dyn BytesPartialEncoderTraits>,
shape: &[NonZeroU64],
data_type: &DataType,
fill_value: &FillValue,
_options: &CodecOptions,
) -> Result<Arc<dyn ArrayPartialEncoderTraits>, CodecError>
fn partial_encoder( self: Arc<Self>, input_output_handle: Arc<dyn BytesPartialEncoderTraits>, shape: &[NonZeroU64], data_type: &DataType, fill_value: &FillValue, _options: &CodecOptions, ) -> Result<Arc<dyn ArrayPartialEncoderTraits>, CodecError>
Initialise a partial encoder. Read more
Source§fn async_partial_decoder<'life0, 'life1, 'life2, 'life3, 'async_trait>(
self: Arc<Self>,
input_handle: Arc<dyn AsyncBytesPartialDecoderTraits>,
shape: &'life0 [NonZeroU64],
data_type: &'life1 DataType,
fill_value: &'life2 FillValue,
_options: &'life3 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsyncArrayPartialDecoderTraits>, CodecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn async_partial_decoder<'life0, 'life1, 'life2, 'life3, 'async_trait>(
self: Arc<Self>,
input_handle: Arc<dyn AsyncBytesPartialDecoderTraits>,
shape: &'life0 [NonZeroU64],
data_type: &'life1 DataType,
fill_value: &'life2 FillValue,
_options: &'life3 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsyncArrayPartialDecoderTraits>, CodecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Available on crate feature
async only.Initialise an asynchronous partial decoder. Read more
Source§fn async_partial_encoder<'life0, 'life1, 'life2, 'life3, 'async_trait>(
self: Arc<Self>,
input_output_handle: Arc<dyn AsyncBytesPartialEncoderTraits>,
shape: &'life0 [NonZeroU64],
data_type: &'life1 DataType,
fill_value: &'life2 FillValue,
_options: &'life3 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsyncArrayPartialEncoderTraits>, CodecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn async_partial_encoder<'life0, 'life1, 'life2, 'life3, 'async_trait>(
self: Arc<Self>,
input_output_handle: Arc<dyn AsyncBytesPartialEncoderTraits>,
shape: &'life0 [NonZeroU64],
data_type: &'life1 DataType,
fill_value: &'life2 FillValue,
_options: &'life3 CodecOptions,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn AsyncArrayPartialEncoderTraits>, CodecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Available on crate feature
async only.Initialise an asynchronous partial encoder. Read more
Source§fn encoded_representation(
&self,
shape: &[NonZeroU64],
data_type: &DataType,
_fill_value: &FillValue,
) -> Result<BytesRepresentation, CodecError>
fn encoded_representation( &self, shape: &[NonZeroU64], data_type: &DataType, _fill_value: &FillValue, ) -> Result<BytesRepresentation, CodecError>
Returns the size of the encoded representation given a size of the decoded representation. Read more
Source§fn compact<'a>(
&self,
bytes: Cow<'a, [u8]>,
shape: &[NonZero<u64>],
data_type: &DataType,
fill_value: &FillValue,
options: &CodecOptions,
) -> Result<Option<Cow<'a, [u8]>>, CodecError>
fn compact<'a>( &self, bytes: Cow<'a, [u8]>, shape: &[NonZero<u64>], data_type: &DataType, fill_value: &FillValue, options: &CodecOptions, ) -> Result<Option<Cow<'a, [u8]>>, CodecError>
Compact a chunk. Read more
Source§fn decode_into(
&self,
bytes: Cow<'_, [u8]>,
shape: &[NonZero<u64>],
data_type: &DataType,
fill_value: &FillValue,
output_target: ArrayBytesDecodeIntoTarget<'_>,
options: &CodecOptions,
) -> Result<(), CodecError>
fn decode_into( &self, bytes: Cow<'_, [u8]>, shape: &[NonZero<u64>], data_type: &DataType, fill_value: &FillValue, output_target: ArrayBytesDecodeIntoTarget<'_>, options: &CodecOptions, ) -> Result<(), CodecError>
Decode into a subset of a preallocated output. Read more
Source§impl Clone for BytesCodec
impl Clone for BytesCodec
Source§fn clone(&self) -> BytesCodec
fn clone(&self) -> BytesCodec
Returns a duplicate 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 BytesCodec
impl CodecTraits for BytesCodec
Source§fn configuration(
&self,
_version: ZarrVersion,
_options: &CodecMetadataOptions,
) -> Option<Configuration>
fn configuration( &self, _version: ZarrVersion, _options: &CodecMetadataOptions, ) -> Option<Configuration>
Create the codec configuration. Read more
Source§fn partial_decoder_capability(&self) -> PartialDecoderCapability
fn partial_decoder_capability(&self) -> PartialDecoderCapability
Returns the partial decoder capability of this codec.
Source§fn partial_encoder_capability(&self) -> PartialEncoderCapability
fn partial_encoder_capability(&self) -> PartialEncoderCapability
Returns the partial encoder capability of this codec.
Source§fn configuration_v3(
&self,
options: &CodecMetadataOptions,
) -> Option<Configuration>
fn configuration_v3( &self, options: &CodecMetadataOptions, ) -> Option<Configuration>
Create the Zarr V3 codec configuration.
Source§fn configuration_v2(
&self,
options: &CodecMetadataOptions,
) -> Option<Configuration>
fn configuration_v2( &self, options: &CodecMetadataOptions, ) -> Option<Configuration>
Create the Zarr V2 codec configuration.
Source§impl CodecTraitsV3 for BytesCodec
impl CodecTraitsV3 for BytesCodec
Source§fn create(metadata: &MetadataV3) -> Result<Codec, PluginCreateError>
fn create(metadata: &MetadataV3) -> Result<Codec, PluginCreateError>
Create a codec from Zarr V3 metadata. Read more
Source§impl Debug for BytesCodec
impl Debug for BytesCodec
Source§impl Default for BytesCodec
impl Default for BytesCodec
Source§impl ExtensionAliases<ZarrVersion2> for BytesCodec
impl ExtensionAliases<ZarrVersion2> for BytesCodec
Source§fn aliases() -> RwLockReadGuard<'static, ExtensionAliasesConfig>
fn aliases() -> RwLockReadGuard<'static, ExtensionAliasesConfig>
Get a read lock on the aliases configuration for this version.
Source§fn aliases_mut() -> RwLockWriteGuard<'static, ExtensionAliasesConfig>
fn aliases_mut() -> RwLockWriteGuard<'static, ExtensionAliasesConfig>
Get a write lock on the aliases configuration for this version.
Source§impl ExtensionAliases<ZarrVersion3> for BytesCodec
impl ExtensionAliases<ZarrVersion3> for BytesCodec
Source§fn aliases() -> RwLockReadGuard<'static, ExtensionAliasesConfig>
fn aliases() -> RwLockReadGuard<'static, ExtensionAliasesConfig>
Get a read lock on the aliases configuration for this version.
Source§fn aliases_mut() -> RwLockWriteGuard<'static, ExtensionAliasesConfig>
fn aliases_mut() -> RwLockWriteGuard<'static, ExtensionAliasesConfig>
Get a write lock on the aliases configuration for this version.
Source§impl ExtensionNameStatic for BytesCodec
impl ExtensionNameStatic for BytesCodec
Source§const DEFAULT_NAME_FN: fn(ZarrVersion) -> Option<Cow<'static, str>>
const DEFAULT_NAME_FN: fn(ZarrVersion) -> Option<Cow<'static, str>>
Function pointer to get the default name for a given Zarr version. Read more
Auto Trait Implementations§
impl Freeze for BytesCodec
impl Send for BytesCodec
impl Sync for BytesCodec
impl RefUnwindSafe for BytesCodec
impl Unpin for BytesCodec
impl UnsafeUnpin for BytesCodec
impl UnwindSafe for BytesCodec
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§impl<T> ExtensionAliasesV2 for Twhere
T: ExtensionAliases<ZarrVersion2>,
impl<T> ExtensionAliasesV2 for Twhere
T: ExtensionAliases<ZarrVersion2>,
Source§fn aliases_v2() -> RwLockReadGuard<'static, ExtensionAliasesConfig>
fn aliases_v2() -> RwLockReadGuard<'static, ExtensionAliasesConfig>
Get a read lock on the V2 aliases configuration.
Source§fn aliases_v2_mut() -> RwLockWriteGuard<'static, ExtensionAliasesConfig>
fn aliases_v2_mut() -> RwLockWriteGuard<'static, ExtensionAliasesConfig>
Get a write lock on the V2 aliases configuration.
Source§fn matches_name_v2(name: &str) -> bool
fn matches_name_v2(name: &str) -> bool
Check if the given name matches this extension for Zarr V2.
Source§impl<T> ExtensionAliasesV3 for Twhere
T: ExtensionAliases<ZarrVersion3>,
impl<T> ExtensionAliasesV3 for Twhere
T: ExtensionAliases<ZarrVersion3>,
Source§fn aliases_v3() -> RwLockReadGuard<'static, ExtensionAliasesConfig>
fn aliases_v3() -> RwLockReadGuard<'static, ExtensionAliasesConfig>
Get a read lock on the V3 aliases configuration.
Source§fn aliases_v3_mut() -> RwLockWriteGuard<'static, ExtensionAliasesConfig>
fn aliases_v3_mut() -> RwLockWriteGuard<'static, ExtensionAliasesConfig>
Get a write lock on the V3 aliases configuration.
Source§fn matches_name_v3(name: &str) -> bool
fn matches_name_v3(name: &str) -> bool
Check if the given name matches this extension for Zarr V3.
Source§impl<T> ExtensionName for Twhere
T: ExtensionNameStatic,
impl<T> ExtensionName for Twhere
T: ExtensionNameStatic,
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