Struct DataArray

Source
pub struct DataArray {
    pub scalar_type: ScalarType,
    pub name: String,
    pub format: DataArrayFormat,
    pub offset: Option<u32>,
    pub num_comp: u32,
    pub range_min: Option<f64>,
    pub range_max: Option<f64>,
    pub data: Vec<Data>,
}

Fields§

§scalar_type: ScalarType§name: String§format: DataArrayFormat§offset: Option<u32>§num_comp: u32§range_min: Option<f64>§range_max: Option<f64>§data: Vec<Data>

Implementations§

Source§

impl DataArray

Source

pub fn from_model_data_array(data: DataArray, ei: EncodingInfo) -> Self

Construct a binary DataArray from a given model::DataArray.

Source

pub fn from_field_array(field: FieldArray, ei: EncodingInfo) -> Self

Construct a binary DataArray from a given model::FieldArray.

Source

pub fn from_io_buffer(buf: IOBuffer, ei: EncodingInfo) -> Self

Construct a binary DataArray from a given model::IOBuffer.

Source

pub fn with_name(self, name: impl Into<String>) -> Self

Returns the given DataArray with name set to name.

Source

pub fn with_num_comp(self, num_comp: u32) -> Self

Returns the given DataArray with the given number of components num_comp.

Source

pub fn into_field_array( self, l: usize, appended: Option<&AppendedData>, ei: EncodingInfo, ) -> Result<FieldArray, ValidationError>

Convert this data array into a model::FieldArray type.

The given arguments are the number of elements (not bytes) in the expected output buffer and an optional appended data reference.

Source

pub fn into_model_data_array( self, l: usize, appended: Option<&AppendedData>, info: &AttributeInfo, ei: EncodingInfo, ) -> Result<DataArray, ValidationError>

Convert this data array into a model::DataArray type.

The given arguments are the number of elements (not bytes) in the expected output buffer and an optional appended data reference.

Source

pub fn into_io_buffer( self, num_elements: usize, appended: Option<&AppendedData>, ei: EncodingInfo, ) -> Result<IOBuffer, ValidationError>

Convert this data array into an IOBuffer.

This is the same as into_field_array but only keeps the IOBuffer part.

Source

pub fn into_attribute( self, num_elements: usize, appended: Option<&AppendedData>, info: &AttributeInfo, ei: EncodingInfo, ) -> Result<Attribute, ValidationError>

Trait Implementations§

Source§

impl Clone for DataArray

Source§

fn clone(&self) -> DataArray

Returns a duplicate 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 DataArray

Source§

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

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

impl Default for DataArray

Source§

fn default() -> DataArray

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DataArray

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 PartialEq for DataArray

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for DataArray

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 DataArray

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,