Struct arrow::datatypes::Field[][src]

pub struct Field { /* fields omitted */ }

Contains the meta-data for a single relative type.

The Schema object is an ordered collection of Field objects.

Implementations

impl Field[src]

pub fn new(name: &str, data_type: DataType, nullable: bool) -> Self[src]

Creates a new field

pub fn new_dict(
    name: &str,
    data_type: DataType,
    nullable: bool,
    dict_id: i64,
    dict_is_ordered: bool
) -> Self
[src]

Creates a new field

pub fn set_metadata(&mut self, metadata: Option<BTreeMap<String, String>>)[src]

Sets the Field’s optional custom metadata. The metadata is set as None for empty map.

pub const fn metadata(&self) -> &Option<BTreeMap<String, String>>[src]

Returns the immutable reference to the Field’s optional custom metadata.

pub const fn name(&self) -> &String[src]

Returns an immutable reference to the Field’s name.

pub const fn data_type(&self) -> &DataType[src]

Returns an immutable reference to the Field’s data-type.

pub const fn is_nullable(&self) -> bool[src]

Indicates whether this Field supports null values.

pub const fn dict_id(&self) -> Option<i64>[src]

Returns the dictionary ID, if this is a dictionary type.

pub const fn dict_is_ordered(&self) -> Option<bool>[src]

Returns whether this Field’s dictionary is ordered, if this is a dictionary type.

pub fn from(json: &Value) -> Result<Self>[src]

Parse a Field definition from a JSON representation.

pub fn to_json(&self) -> Value[src]

Generate a JSON representation of the Field.

pub fn try_merge(&mut self, from: &Field) -> Result<()>[src]

Merge field into self if it is compatible. Struct will be merged recursively. NOTE: self may be updated to unexpected state in case of merge failure.

Example:

use arrow::datatypes::*;

let mut field = Field::new("c1", DataType::Int64, false);
assert!(field.try_merge(&Field::new("c1", DataType::Int64, true)).is_ok());
assert!(field.is_nullable());

pub fn contains(&self, other: &Field) -> bool[src]

Check to see if self is a superset of other field. Superset is defined as:

  • if nullability doesn’t match, self needs to be nullable
  • self.metadata is a superset of other.metadata
  • all other fields are equal

Trait Implementations

impl Clone for Field[src]

impl Debug for Field[src]

impl<'de> Deserialize<'de> for Field[src]

impl Display for Field[src]

impl Eq for Field[src]

impl From<&'_ Field> for ArrowJsonField[src]

impl<'a> From<Field<'a>> for Field[src]

Convert an IPC Field to Arrow Field

impl Hash for Field[src]

impl Ord for Field[src]

impl PartialEq<Field> for Field[src]

impl PartialOrd<Field> for Field[src]

impl Serialize for Field[src]

impl StructuralEq for Field[src]

impl StructuralPartialEq for Field[src]

Auto Trait Implementations

impl RefUnwindSafe for Field

impl Send for Field

impl Sync for Field

impl Unpin for Field

impl UnwindSafe for Field

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,