pub struct Field { /* private fields */ }
Expand description

Characterizes the name and the DataType of a column.

Implementations

Creates a new Field.

Example
let f1 = Field::new("Fruit name", DataType::Utf8);
let f2 = Field::new("Lawful", DataType::Boolean);
let f2 = Field::new("Departure", DataType::Time);

Returns a reference to the Field name.

Example
let f = Field::new("Year", DataType::Int32);

assert_eq!(f.name(), "Year");

Returns a reference to the Field datatype.

Example
let f = Field::new("Birthday", DataType::Date);

assert_eq!(f.data_type(), &DataType::Date);

Sets the Field datatype.

Example
let mut f = Field::new("Temperature", DataType::Int32);
f.coerce(DataType::Float32);

assert_eq!(f, Field::new("Temperature", DataType::Float32));

Sets the Field name.

Example
let mut f = Field::new("Atomic number", DataType::UInt32);
f.set_name("Proton".to_owned());

assert_eq!(f, Field::new("Proton", DataType::UInt32));

Converts the Field to an arrow::datatypes::Field.

Example
let f = Field::new("Value", DataType::Int64);
let af = arrow::datatypes::Field::new("Value", arrow::datatypes::DataType::Int64, true);

assert_eq!(f.to_arrow(), af);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.