pub struct NdArrayType { /* private fields */ }Expand description
The nd extension type: the element field of the values, plus the attribute fields.
Implementations§
Source§impl NdArrayType
impl NdArrayType
Sourcepub fn new(value_type: DataType, attrs: Fields) -> Self
pub fn new(value_type: DataType, attrs: Fields) -> Self
An nd type with nullable values of value_type and the given attribute fields.
Sourcepub fn with_value_field(value_field: FieldRef, attrs: Fields) -> Self
pub fn with_value_field(value_field: FieldRef, attrs: Fields) -> Self
An nd type with a custom item field for the values list, for example to keep nested extension metadata on the elements.
Sourcepub fn value_field(&self) -> &FieldRef
pub fn value_field(&self) -> &FieldRef
The item field of the values list.
Sourcepub fn value_type(&self) -> &DataType
pub fn value_type(&self) -> &DataType
The Arrow type of the array values.
Sourcepub fn attribute_fields(&self) -> &Fields
pub fn attribute_fields(&self) -> &Fields
One field per attribute key. Empty when there are no attributes.
Sourcepub fn storage_type(&self) -> DataType
pub fn storage_type(&self) -> DataType
The storage type of this extension type.
Sourcepub fn has_attributes(&self) -> bool
pub fn has_attributes(&self) -> bool
True when the storage has an attrs field.
Sourcepub fn try_from_storage_type(data_type: &DataType) -> Result<Self>
pub fn try_from_storage_type(data_type: &DataType) -> Result<Self>
Parse the storage layout. This ignores field metadata.
An attrs struct with zero fields reads as no attributes.
Trait Implementations§
Source§impl Clone for NdArrayType
impl Clone for NdArrayType
Source§impl Debug for NdArrayType
impl Debug for NdArrayType
impl Eq for NdArrayType
Source§impl ExtensionType for NdArrayType
impl ExtensionType for NdArrayType
Source§const NAME: &'static str = "nd_arrow.array"
const NAME: &'static str = "nd_arrow.array"
The name identifying this extension type. Read more
Source§type Metadata = NdArrayMetadata
type Metadata = NdArrayMetadata
The metadata type of this extension type. Read more
Source§fn metadata(&self) -> &Self::Metadata
fn metadata(&self) -> &Self::Metadata
Returns a reference to the metadata of this extension type, or
&() if
if this extension type defines no metadata (Self::Metadata=()).Source§fn serialize_metadata(&self) -> Option<String>
fn serialize_metadata(&self) -> Option<String>
Returns the serialized representation of the metadata of this extension
type, or
None if this extension type defines no metadata
(Self::Metadata=()). Read moreSource§fn deserialize_metadata(
metadata: Option<&str>,
) -> Result<Self::Metadata, ArrowError>
fn deserialize_metadata( metadata: Option<&str>, ) -> Result<Self::Metadata, ArrowError>
Deserialize the metadata of this extension type from the serialized
representation of the metadata. An extension type that defines no
metadata should expect
None for the serialized metadata and return
Ok(()). Read moreSource§fn supports_data_type(&self, data_type: &DataType) -> Result<(), ArrowError>
fn supports_data_type(&self, data_type: &DataType) -> Result<(), ArrowError>
Returns
Ok(()) iff the given data type is supported by this extension
type.Source§fn try_new(
data_type: &DataType,
metadata: Self::Metadata,
) -> Result<Self, ArrowError>
fn try_new( data_type: &DataType, metadata: Self::Metadata, ) -> Result<Self, ArrowError>
Construct this extension type for a field with the given data type and
metadata. Read more
Source§fn validate(
data_type: &DataType,
metadata: Self::Metadata,
) -> Result<(), ArrowError>
fn validate( data_type: &DataType, metadata: Self::Metadata, ) -> Result<(), ArrowError>
Validate this extension type for a field with the given data type and
metadata. Read more
Source§fn try_new_from_field_metadata(
data_type: &DataType,
metadata: &HashMap<String, String>,
) -> Result<Self, ArrowError>
fn try_new_from_field_metadata( data_type: &DataType, metadata: &HashMap<String, String>, ) -> Result<Self, ArrowError>
Construct this extension type from field metadata and data type. Read more
Source§impl PartialEq for NdArrayType
impl PartialEq for NdArrayType
impl StructuralPartialEq for NdArrayType
Auto Trait Implementations§
impl Freeze for NdArrayType
impl RefUnwindSafe for NdArrayType
impl Send for NdArrayType
impl Sync for NdArrayType
impl Unpin for NdArrayType
impl UnsafeUnpin for NdArrayType
impl UnwindSafe for NdArrayType
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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