pub struct Attributes { /* private fields */ }Expand description
An ordered set of named, length-1 Arrow values.
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn get_primitive<T: ArrowPrimitiveType>(
&self,
name: &str,
) -> Option<T::Native>
pub fn get_primitive<T: ArrowPrimitiveType>( &self, name: &str, ) -> Option<T::Native>
Convenience access for a primitive attribute of type T.
Sourcepub fn insert(&mut self, name: impl Into<Arc<str>>, value: impl IntoScalar)
pub fn insert(&mut self, name: impl Into<Arc<str>>, value: impl IntoScalar)
Insert or replace an attribute.
Sourcepub fn try_insert_array(
&mut self,
name: impl Into<Arc<str>>,
value: ArrayRef,
) -> Result<()>
pub fn try_insert_array( &mut self, name: impl Into<Arc<str>>, value: ArrayRef, ) -> Result<()>
Insert or replace an attribute from an Arrow array of length 1.
Sourcepub fn with(self, name: impl Into<Arc<str>>, value: impl IntoScalar) -> Self
pub fn with(self, name: impl Into<Arc<str>>, value: impl IntoScalar) -> Self
Builder form of Self::insert.
Sourcepub fn remove(&mut self, name: &str) -> Option<ArrayRef>
pub fn remove(&mut self, name: &str) -> Option<ArrayRef>
Remove attribute name and return its value.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &ArrayRef)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &ArrayRef)>
The attributes in insertion order.
Sourcepub fn fields(&self) -> Fields
pub fn fields(&self) -> Fields
The attrs struct fields for these attributes. All fields are nullable.
Sourcepub fn from_struct_row(attrs: &StructArray, row: usize) -> Self
pub fn from_struct_row(attrs: &StructArray, row: usize) -> Self
Read row row of an attrs struct. A null child value is an absent attribute.
Sourcepub fn union_fields<'a>(
all: impl IntoIterator<Item = &'a Attributes>,
) -> Result<Fields>
pub fn union_fields<'a>( all: impl IntoIterator<Item = &'a Attributes>, ) -> Result<Fields>
The struct fields for the union of the keys in all. One key with two
types is an error.
Sourcepub fn encode_rows(
rows: &[Option<&Attributes>],
fields: &Fields,
) -> Result<StructArray>
pub fn encode_rows( rows: &[Option<&Attributes>], fields: &Fields, ) -> Result<StructArray>
Encode one struct row per entry of rows, with fields from
Self::union_fields. A missing key or a None row gives nulls.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Attributes
impl !UnwindSafe for Attributes
impl Freeze for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnsafeUnpin for Attributes
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
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> ⓘ
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