pub trait SchemaExt {
// Required methods
fn from_arrow_schema(value: &Schema<Field>) -> Self;
fn get_field(&self, name: &str) -> Option<Field>;
fn try_get_field(&self, name: &str) -> Result<Field, PolarsError>;
fn to_arrow(&self, compat_level: CompatLevel) -> Schema<Field>;
fn iter_fields(&self) -> impl ExactSizeIterator;
fn to_supertype(
&mut self,
other: &Schema<DataType>,
) -> Result<bool, PolarsError>;
}
Required Methods§
fn from_arrow_schema(value: &Schema<Field>) -> Self
fn get_field(&self, name: &str) -> Option<Field>
fn try_get_field(&self, name: &str) -> Result<Field, PolarsError>
fn to_arrow(&self, compat_level: CompatLevel) -> Schema<Field>
fn iter_fields(&self) -> impl ExactSizeIterator
fn to_supertype( &mut self, other: &Schema<DataType>, ) -> Result<bool, PolarsError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl SchemaExt for Schema<DataType>
impl SchemaExt for Schema<DataType>
Source§fn try_get_field(&self, name: &str) -> Result<Field, PolarsError>
fn try_get_field(&self, name: &str) -> Result<Field, PolarsError>
Source§fn to_arrow(&self, compat_level: CompatLevel) -> Schema<Field>
fn to_arrow(&self, compat_level: CompatLevel) -> Schema<Field>
Convert self to ArrowSchema
by cloning the fields.
Source§fn iter_fields(&self) -> impl ExactSizeIterator
fn iter_fields(&self) -> impl ExactSizeIterator
Source§fn to_supertype(
&mut self,
other: &Schema<DataType>,
) -> Result<bool, PolarsError>
fn to_supertype( &mut self, other: &Schema<DataType>, ) -> Result<bool, PolarsError>
Take another Schema
and try to find the supertypes between them.