#[non_exhaustive]pub struct ArrayMetadataV3 {Show 13 fields
pub zarr_format: MustBeU64<3>,
pub node_type: MustBeStr<(char<monostate::::alphabet::a::{constant#0}>, char<monostate::::alphabet::r::{constant#0}>, char<monostate::::alphabet::r::{constant#0}>, char<monostate::::alphabet::a::{constant#0}>, char<monostate::::alphabet::y::{constant#0}>)>,
pub shape: Vec<u64>,
pub data_type: MetadataV3,
pub chunk_grid: MetadataV3,
pub chunk_key_encoding: MetadataV3,
pub fill_value: FillValueMetadataV3,
pub codecs: Vec<MetadataV3>,
pub attributes: Map<String, Value>,
pub storage_transformers: Vec<MetadataV3>,
pub dimension_names: Option<Vec<Option<String>>>,
pub extensions: Vec<MetadataV3>,
pub additional_fields: BTreeMap<String, AdditionalFieldV3>,
}
Expand description
Zarr V3 array metadata.
An example JSON
document for a Zarr V3 array:
{
"zarr_format": 3,
"node_type": "array",
"shape": [10000, 1000],
"dimension_names": ["rows", "columns"],
"data_type": "float64",
"chunk_grid": {
"name": "regular",
"configuration": {
"chunk_shape": [1000, 100]
}
},
"chunk_key_encoding": {
"name": "default",
"configuration": {
"separator": "/"
}
},
"codecs": [{
"name": "gzip",
"configuration": {
"level": 1
}
}],
"fill_value": "NaN",
"attributes": {
"foo": 42,
"bar": "apples",
"baz": [1, 2, 3, 4]
}
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.zarr_format: MustBeU64<3>
An integer defining the version of the storage specification to which the array adheres. Must be 3
.
node_type: MustBeStr<(char<monostate::::alphabet::a::{constant#0}>, char<monostate::::alphabet::r::{constant#0}>, char<monostate::::alphabet::r::{constant#0}>, char<monostate::::alphabet::a::{constant#0}>, char<monostate::::alphabet::y::{constant#0}>)>
A string defining the type of hierarchy node element, must be array
here.
shape: Vec<u64>
An array of integers providing the length of each dimension of the Zarr array.
data_type: MetadataV3
The data type of the Zarr array.
chunk_grid: MetadataV3
The chunk grid of the Zarr array.
chunk_key_encoding: MetadataV3
The mapping from chunk grid cell coordinates to keys in the underlying store.
fill_value: FillValueMetadataV3
Provides an element value to use for uninitialised portions of the Zarr array.
Suitable values are dependent on the data type.
Boolean. The value must be a JSON boolean (false or true).
Signed integers (int{8,16,32,64}
) or unsigned integers (uint{8,16,32,64}
).
The value must be a JSON number with no fraction or exponent part that is within the representable range of the data type.
Floating point numbers (float{16,32,64}
, bfloat16
).
- A JSON number, that will be rounded to the nearest representable value.
- A JSON string of the form:
"Infinity"
, denoting positive infinity;"-Infinity"
, denoting negative infinity;"NaN"
, denoting thenot-a-number (NaN) value where the sign bit is 0 (positive), the most significant bit (MSB) of the mantissa is 1, and all other bits of the mantissa are zero;- *
"0xYYYYYYYY"
, specifying the byte representation of the floating point number as an unsigned integer.
Complex numbers (complex{64,128}
)
The value must be a two-element array, specifying the real and imaginary components respectively, where each component is specified as defined above for floating point number.
Raw data types (r<N>
)
An array of integers, with length equal to <N>
, where each integer is in the range [0, 255]
.
codecs: Vec<MetadataV3>
Specifies a list of codecs to be used for encoding and decoding chunks.
attributes: Map<String, Value>
Optional user defined attributes.
storage_transformers: Vec<MetadataV3>
An optional list of storage transformers.
dimension_names: Option<Vec<Option<String>>>
An optional list of dimension names.
extensions: Vec<MetadataV3>
Extension definitions (Zarr 3.1, ZEP0009).
additional_fields: BTreeMap<String, AdditionalFieldV3>
Additional fields.
Implementations§
Source§impl ArrayMetadataV3
impl ArrayMetadataV3
Sourcepub fn new(
shape: Vec<u64>,
chunk_grid: MetadataV3,
data_type: MetadataV3,
fill_value: FillValueMetadataV3,
codecs: Vec<MetadataV3>,
) -> ArrayMetadataV3
pub fn new( shape: Vec<u64>, chunk_grid: MetadataV3, data_type: MetadataV3, fill_value: FillValueMetadataV3, codecs: Vec<MetadataV3>, ) -> ArrayMetadataV3
Create new Zarr V3 array metadata.
Defaults to:
default
chunk key encoding with the ‘/’ separator,- empty attributes,
- no dimension names,
- no storage transformers,
- no extensions, and
- no additional fields.
Sourcepub fn to_string_pretty(&self) -> String
pub fn to_string_pretty(&self) -> String
Serialize the metadata as a pretty-printed String of JSON.
Sourcepub fn with_attributes(self, attributes: Map<String, Value>) -> ArrayMetadataV3
pub fn with_attributes(self, attributes: Map<String, Value>) -> ArrayMetadataV3
Set the user attributes.
Sourcepub fn with_additional_fields(
self,
additional_fields: BTreeMap<String, AdditionalFieldV3>,
) -> ArrayMetadataV3
pub fn with_additional_fields( self, additional_fields: BTreeMap<String, AdditionalFieldV3>, ) -> ArrayMetadataV3
Set the additional fields.
Sourcepub fn with_chunk_key_encoding(
self,
chunk_key_encoding: MetadataV3,
) -> ArrayMetadataV3
pub fn with_chunk_key_encoding( self, chunk_key_encoding: MetadataV3, ) -> ArrayMetadataV3
Set the chunk key encoding.
Sourcepub fn with_dimension_names<I, D>(
self,
dimension_names: Option<I>,
) -> ArrayMetadataV3where
I: IntoIterator<Item = D>,
D: IntoDimensionName,
pub fn with_dimension_names<I, D>(
self,
dimension_names: Option<I>,
) -> ArrayMetadataV3where
I: IntoIterator<Item = D>,
D: IntoDimensionName,
Set the dimension names.
Sourcepub fn with_storage_transformers(
self,
storage_transformers: Vec<MetadataV3>,
) -> ArrayMetadataV3
pub fn with_storage_transformers( self, storage_transformers: Vec<MetadataV3>, ) -> ArrayMetadataV3
Set the storage transformers.
Sourcepub fn with_extensions(self, extensions: Vec<MetadataV3>) -> ArrayMetadataV3
pub fn with_extensions(self, extensions: Vec<MetadataV3>) -> ArrayMetadataV3
Set the extension definitions.
Trait Implementations§
Source§impl Clone for ArrayMetadataV3
impl Clone for ArrayMetadataV3
Source§fn clone(&self) -> ArrayMetadataV3
fn clone(&self) -> ArrayMetadataV3
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ArrayMetadataV3
impl Debug for ArrayMetadataV3
Source§impl<'de> Deserialize<'de> for ArrayMetadataV3
impl<'de> Deserialize<'de> for ArrayMetadataV3
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArrayMetadataV3, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArrayMetadataV3, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for ArrayMetadataV3
impl Display for ArrayMetadataV3
Source§impl From<ArrayMetadataV3> for ArrayMetadata
impl From<ArrayMetadataV3> for ArrayMetadata
Source§fn from(value: ArrayMetadataV3) -> ArrayMetadata
fn from(value: ArrayMetadataV3) -> ArrayMetadata
Source§impl PartialEq for ArrayMetadataV3
impl PartialEq for ArrayMetadataV3
Source§impl Serialize for ArrayMetadataV3
impl Serialize for ArrayMetadataV3
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ArrayMetadataV3
Auto Trait Implementations§
impl Freeze for ArrayMetadataV3
impl RefUnwindSafe for ArrayMetadataV3
impl Send for ArrayMetadataV3
impl Sync for ArrayMetadataV3
impl Unpin for ArrayMetadataV3
impl UnwindSafe for ArrayMetadataV3
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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