pub struct NamedDataType { /* private fields */ }Expand description
A named data type.
Implementations§
Source§impl NamedDataType
impl NamedDataType
Sourcepub fn new(name: String, data_type: DataType) -> Self
pub fn new(name: String, data_type: DataType) -> Self
Create a new NamedDataType.
Sourcepub fn fill_value_from_metadata(
&self,
fill_value: &FillValueMetadataV3,
) -> Result<FillValue, DataTypeFillValueMetadataError>
pub fn fill_value_from_metadata( &self, fill_value: &FillValueMetadataV3, ) -> Result<FillValue, DataTypeFillValueMetadataError>
Create a fill value from metadata.
§Errors
Returns DataTypeFillValueMetadataError if the fill value is incompatible with the data type.
Methods from Deref<Target = DataType>§
Sourcepub fn metadata(&self) -> MetadataV3
pub fn metadata(&self) -> MetadataV3
Returns the metadata.
Sourcepub fn size(&self) -> DataTypeSize
pub fn size(&self) -> DataTypeSize
Returns the DataTypeSize.
Sourcepub fn fixed_size(&self) -> Option<usize>
pub fn fixed_size(&self) -> Option<usize>
Returns the size in bytes of a fixed-size data type, otherwise returns None.
Sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Returns true if the data type has a variable size.
Sourcepub fn fill_value_from_metadata(
&self,
fill_value: &FillValueMetadataV3,
) -> Result<FillValue, DataTypeFillValueMetadataError>
pub fn fill_value_from_metadata( &self, fill_value: &FillValueMetadataV3, ) -> Result<FillValue, DataTypeFillValueMetadataError>
Create a fill value from metadata.
§Errors
Returns DataTypeFillValueMetadataError if the fill value is incompatible with the data type.
Sourcepub fn metadata_fill_value(
&self,
fill_value: &FillValue,
) -> Result<FillValueMetadataV3, DataTypeFillValueError>
pub fn metadata_fill_value( &self, fill_value: &FillValue, ) -> Result<FillValueMetadataV3, DataTypeFillValueError>
Create fill value metadata.
§Errors
Returns an DataTypeFillValueError if the metadata cannot be created from the fill value.
Trait Implementations§
Source§impl Clone for NamedDataType
impl Clone for NamedDataType
Source§impl Debug for NamedDataType
impl Debug for NamedDataType
Source§impl Deref for NamedDataType
impl Deref for NamedDataType
Auto Trait Implementations§
impl Freeze for NamedDataType
impl Send for NamedDataType
impl Sync for NamedDataType
impl !RefUnwindSafe for NamedDataType
impl Unpin for NamedDataType
impl !UnwindSafe for NamedDataType
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> 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