Struct arrow_schema::UnionFields
source · pub struct UnionFields(_);
Expand description
A cheaply cloneable, owned collection of FieldRef
and their corresponding type ids
Implementations§
source§impl UnionFields
impl UnionFields
sourcepub fn empty() -> Self
pub fn empty() -> Self
Create a new UnionFields
with no fields
sourcepub fn new<F, T>(type_ids: T, fields: F) -> Selfwhere
F: IntoIterator,
F::Item: Into<FieldRef>,
T: IntoIterator<Item = i8>,
pub fn new<F, T>(type_ids: T, fields: F) -> Selfwhere F: IntoIterator, F::Item: Into<FieldRef>, T: IntoIterator<Item = i8>,
Create a new UnionFields
from a Fields
and array of type_ids
See https://arrow.apache.org/docs/format/Columnar.html#union-layout
use arrow_schema::{DataType, Field, UnionFields};
// Create a new UnionFields with type id mapping
// 1 -> DataType::UInt8
// 3 -> DataType::Utf8
UnionFields::new(
vec![1, 3],
vec![
Field::new("field1", DataType::UInt8, false),
Field::new("field3", DataType::Utf8, false),
],
);
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of fields in this UnionFields
Trait Implementations§
source§impl Clone for UnionFields
impl Clone for UnionFields
source§fn clone(&self) -> UnionFields
fn clone(&self) -> UnionFields
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UnionFields
impl Debug for UnionFields
source§impl FromIterator<(i8, Arc<Field, Global>)> for UnionFields
impl FromIterator<(i8, Arc<Field, Global>)> for UnionFields
source§impl Hash for UnionFields
impl Hash for UnionFields
source§impl Ord for UnionFields
impl Ord for UnionFields
source§fn cmp(&self, other: &UnionFields) -> Ordering
fn cmp(&self, other: &UnionFields) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<UnionFields> for UnionFields
impl PartialEq<UnionFields> for UnionFields
source§fn eq(&self, other: &UnionFields) -> bool
fn eq(&self, other: &UnionFields) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<UnionFields> for UnionFields
impl PartialOrd<UnionFields> for UnionFields
source§fn partial_cmp(&self, other: &UnionFields) -> Option<Ordering>
fn partial_cmp(&self, other: &UnionFields) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for UnionFields
impl StructuralEq for UnionFields
impl StructuralPartialEq for UnionFields
Auto Trait Implementations§
impl RefUnwindSafe for UnionFields
impl Send for UnionFields
impl Sync for UnionFields
impl Unpin for UnionFields
impl UnwindSafe for UnionFields
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