Struct UnionFields
pub struct UnionFields(Arc<[(i8, Arc<Field>)]>);
Expand description
A cheaply cloneable, owned collection of FieldRef
and their corresponding type ids
Tuple Fields§
§0: Arc<[(i8, Arc<Field>)]>
Implementations§
§impl UnionFields
impl UnionFields
pub fn empty() -> UnionFields
pub fn empty() -> UnionFields
Create a new UnionFields
with no fields
pub fn new<F, T>(type_ids: T, fields: F) -> UnionFields
pub fn new<F, T>(type_ids: T, fields: F) -> UnionFields
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),
],
);
pub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of fields in this UnionFields
Trait Implementations§
§impl Clone for UnionFields
impl Clone for UnionFields
§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 more§impl Debug for UnionFields
impl Debug for UnionFields
§impl<'de> Deserialize<'de> for UnionFields
impl<'de> Deserialize<'de> for UnionFields
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnionFields, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnionFields, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl FromIterator<(i8, Arc<Field>)> for UnionFields
impl FromIterator<(i8, Arc<Field>)> for UnionFields
§fn from_iter<T>(iter: T) -> UnionFields
fn from_iter<T>(iter: T) -> UnionFields
Creates a value from an iterator. Read more
§impl Hash for UnionFields
impl Hash for UnionFields
§impl Ord for UnionFields
impl Ord for UnionFields
§impl PartialEq for UnionFields
impl PartialEq for UnionFields
§impl PartialOrd for UnionFields
impl PartialOrd for UnionFields
§impl Serialize for UnionFields
impl Serialize for UnionFields
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for UnionFields
impl StructuralPartialEq for UnionFields
Auto Trait Implementations§
impl Freeze for UnionFields
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.