Struct zarrs::array::ArrayMetadataV3

source ·
pub struct ArrayMetadataV3 {
    pub zarr_format: usize,
    pub node_type: String,
    pub shape: ArrayShape,
    pub data_type: Metadata,
    pub chunk_grid: Metadata,
    pub chunk_key_encoding: Metadata,
    pub fill_value: FillValueMetadata,
    pub codecs: Vec<Metadata>,
    pub attributes: Map<String, Value>,
    pub storage_transformers: Vec<Metadata>,
    pub dimension_names: Option<Vec<DimensionName>>,
    pub additional_fields: AdditionalFields,
}
Expand description

Zarr array metadata (storage specification v3).

An example JSON document for a 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§

§zarr_format: usize

An integer defining the version of the storage specification to which the array store adheres.

§node_type: String

A string defining the type of hierarchy node element, must be array here.

§shape: ArrayShape

An array of integers providing the length of each dimension of the Zarr array.

§data_type: Metadata

The data type of the Zarr array.

§chunk_grid: Metadata

The chunk grid of the Zarr array.

§chunk_key_encoding: Metadata

The mapping from chunk grid cell coordinates to keys in the underlying store.

§fill_value: FillValueMetadata

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<Metadata>

Specifies a list of codecs to be used for encoding and decoding chunks.

§attributes: Map<String, Value>

Optional user defined attributes.

§storage_transformers: Vec<Metadata>

An optional list of storage transformers.

§dimension_names: Option<Vec<DimensionName>>

An optional list of dimension names.

§additional_fields: AdditionalFields

Additional fields.

Implementations§

source§

impl ArrayMetadataV3

source

pub fn new( shape: ArrayShape, data_type: Metadata, chunk_grid: Metadata, chunk_key_encoding: Metadata, fill_value: FillValueMetadata, codecs: Vec<Metadata>, attributes: Map<String, Value>, storage_transformers: Vec<Metadata>, dimension_names: Option<Vec<DimensionName>>, additional_fields: AdditionalFields ) -> Self

Create a new array metadata.

source

pub const fn validate_format(&self) -> bool

Validates that the zarr_format field is 3.

source

pub fn validate_node_type(&self) -> bool

Validates that the node_type is "array".

Trait Implementations§

source§

impl Clone for ArrayMetadataV3

source§

fn clone(&self) -> ArrayMetadataV3

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ArrayMetadataV3

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ArrayMetadataV3

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for ArrayMetadataV3

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ArrayMetadataV3> for ArrayMetadata

source§

fn from(original: ArrayMetadataV3) -> ArrayMetadata

Converts to this type from the input type.
source§

impl PartialEq for ArrayMetadataV3

source§

fn eq(&self, other: &ArrayMetadataV3) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ArrayMetadataV3

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ArrayMetadataV3

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,