Struct deltalake::kernel::models::StructField
source · pub struct StructField {
pub name: String,
pub data_type: DataType,
pub nullable: bool,
pub metadata: HashMap<String, MetadataValue>,
}
Expand description
Represents a struct field defined in the Delta table schema.
Fields§
§name: String
Name of this (possibly nested) column
data_type: DataType
The data type of this field
nullable: bool
Denotes whether this Field can be null
metadata: HashMap<String, MetadataValue>
A JSON map containing information about this column
Implementations§
source§impl StructField
impl StructField
sourcepub fn new(
name: impl Into<String>,
data_type: impl Into<DataType>,
nullable: bool
) -> StructField
pub fn new( name: impl Into<String>, data_type: impl Into<DataType>, nullable: bool ) -> StructField
Creates a new field
sourcepub fn with_metadata(
self,
metadata: impl IntoIterator<Item = (impl Into<String>, impl Into<MetadataValue>)>
) -> StructField
pub fn with_metadata( self, metadata: impl IntoIterator<Item = (impl Into<String>, impl Into<MetadataValue>)> ) -> StructField
Creates a new field with metadata
sourcepub fn get_config_value(
&self,
key: &ColumnMetadataKey
) -> Option<&MetadataValue>
pub fn get_config_value( &self, key: &ColumnMetadataKey ) -> Option<&MetadataValue>
Get the value of a specific metadata key
sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Returns whether the column is nullable
sourcepub fn physical_name(&self) -> Result<&str, Error>
pub fn physical_name(&self) -> Result<&str, Error>
Returns the physical name of the column Equals the name if column mapping is not enabled on table
sourcepub const fn metadata(&self) -> &HashMap<String, MetadataValue>
pub const fn metadata(&self) -> &HashMap<String, MetadataValue>
Returns the metadata of the column
Trait Implementations§
source§impl Borrow<str> for StructField
impl Borrow<str> for StructField
source§impl Clone for StructField
impl Clone for StructField
source§fn clone(&self) -> StructField
fn clone(&self) -> StructField
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 StructField
impl Debug for StructField
source§impl<'de> Deserialize<'de> for StructField
impl<'de> Deserialize<'de> for StructField
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<StructField, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<StructField, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> FromIterator<&'a StructField> for StructType
impl<'a> FromIterator<&'a StructField> for StructType
source§fn from_iter<T>(iter: T) -> StructTypewhere
T: IntoIterator<Item = &'a StructField>,
fn from_iter<T>(iter: T) -> StructTypewhere
T: IntoIterator<Item = &'a StructField>,
Creates a value from an iterator. Read more
source§impl FromIterator<StructField> for StructType
impl FromIterator<StructField> for StructType
source§fn from_iter<T>(iter: T) -> StructTypewhere
T: IntoIterator<Item = StructField>,
fn from_iter<T>(iter: T) -> StructTypewhere
T: IntoIterator<Item = StructField>,
Creates a value from an iterator. Read more
source§impl Hash for StructField
impl Hash for StructField
source§impl PartialEq for StructField
impl PartialEq for StructField
source§fn eq(&self, other: &StructField) -> bool
fn eq(&self, other: &StructField) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for StructField
impl Serialize for StructField
source§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
source§impl TryFrom<&Field> for StructField
impl TryFrom<&Field> for StructField
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(arrow_field: &Field) -> Result<StructField, ArrowError>
fn try_from(arrow_field: &Field) -> Result<StructField, ArrowError>
Performs the conversion.
source§impl TryFrom<&StructField> for Field
impl TryFrom<&StructField> for Field
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(f: &StructField) -> Result<Field, ArrowError>
fn try_from(f: &StructField) -> Result<Field, ArrowError>
Performs the conversion.
impl Eq for StructField
impl StructuralPartialEq for StructField
Auto Trait Implementations§
impl Freeze for StructField
impl RefUnwindSafe for StructField
impl Send for StructField
impl Sync for StructField
impl Unpin for StructField
impl UnwindSafe for StructField
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.