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]
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]
name: &str,
data_type: DataType,
nullable: bool,
dict_id: i64,
dict_is_ordered: bool
) -> Self
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<'de> Deserialize<'de> for Field
[src]
impl<'de> Deserialize<'de> for Field
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialOrd<Field> for Field
[src]
impl PartialOrd<Field> for Field
[src]impl StructuralEq for Field
[src]
impl StructuralEq for Field
[src]impl StructuralPartialEq for Field
[src]
impl StructuralPartialEq for Field
[src]Auto Trait Implementations
impl RefUnwindSafe for Field
impl RefUnwindSafe for Field
impl UnwindSafe for Field
impl UnwindSafe for Field
Blanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,