pub struct NdColumn { /* private fields */ }Expand description
A validated nd column. Each row holds one NdArrowArray or a null.
Construction checks every row once, so Self::value is infallible and
slices the storage without a copy.
Implementations§
Source§impl NdColumn
impl NdColumn
Sourcepub fn try_new(storage: StructArray) -> Result<Self>
pub fn try_new(storage: StructArray) -> Result<Self>
Wrap and validate a storage array.
Sourcepub fn try_from_array(array: &dyn Array) -> Result<Self>
pub fn try_from_array(array: &dyn Array) -> Result<Self>
Wrap and validate a storage array given as an ArrayRef.
Sourcepub fn try_from_arrays<'a>(
arrays: impl IntoIterator<Item = &'a NdArrowArray>,
) -> Result<Self>
pub fn try_from_arrays<'a>( arrays: impl IntoIterator<Item = &'a NdArrowArray>, ) -> Result<Self>
Encode arrays as one row each. arrays must not be empty.
Sourcepub fn new_null(extension: NdArrayType, len: usize) -> Self
pub fn new_null(extension: NdArrayType, len: usize) -> Self
A column of len null rows.
Sourcepub fn extension_type(&self) -> &NdArrayType
pub fn extension_type(&self) -> &NdArrayType
The extension type of the column.
Sourcepub fn value_type(&self) -> &DataType
pub fn value_type(&self) -> &DataType
The Arrow type of the array values.
Sourcepub fn to_field(&self, name: impl Into<String>) -> Field
pub fn to_field(&self, name: impl Into<String>) -> Field
A field named name with the storage type and the extension tag.
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
The number of null rows.
Sourcepub fn get(&self, row: usize) -> Option<NdArrowArray>
pub fn get(&self, row: usize) -> Option<NdArrowArray>
The nd array at row, or None for a null row.
Sourcepub fn value(&self, row: usize) -> NdArrowArray
pub fn value(&self, row: usize) -> NdArrowArray
The nd array at row. A null row gives a rank-0 null scalar,
which broadcasts to an all-null array.
Sourcepub fn dimensions_at(&self, row: usize) -> Dimensions
pub fn dimensions_at(&self, row: usize) -> Dimensions
The dimensions at row. A null row gives scalar dimensions.
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = Option<NdArrowArray>> + '_
pub fn iter(&self) -> impl ExactSizeIterator<Item = Option<NdArrowArray>> + '_
The array of each row, None for null rows.
Sourcepub fn slice(&self, offset: usize, len: usize) -> Self
pub fn slice(&self, offset: usize, len: usize) -> Self
A zero-copy slice of len rows from offset.
Sourcepub fn values_list(&self) -> &ListArray
pub fn values_list(&self) -> &ListArray
The flat values of all rows (the child of the values list).
Sourcepub fn attrs_struct(&self) -> Option<&StructArray>
pub fn attrs_struct(&self) -> Option<&StructArray>
The attrs struct, or None when the column has no attributes.
Sourcepub fn storage(&self) -> &StructArray
pub fn storage(&self) -> &StructArray
The storage Struct array.
Sourcepub fn into_storage(self) -> StructArray
pub fn into_storage(self) -> StructArray
The storage Struct array, by value.
Sourcepub fn into_array_ref(self) -> ArrayRef
pub fn into_array_ref(self) -> ArrayRef
The storage as an ArrayRef.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for NdColumn
impl !UnwindSafe for NdColumn
impl Freeze for NdColumn
impl Send for NdColumn
impl Sync for NdColumn
impl Unpin for NdColumn
impl UnsafeUnpin for NdColumn
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
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<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