Skip to main content

SchemaExt

Trait SchemaExt 

Source
pub trait SchemaExt {
    // Required methods
    fn try_with_column(&self, field: Field) -> Result<Schema, ArrowError>;
    fn try_with_column_at(
        &self,
        index: usize,
        field: Field,
    ) -> Result<Schema, ArrowError>;
    fn field_names(&self) -> Vec<&String>;
    fn without_column(&self, column_name: &str) -> Schema;
    fn to_compact_string(&self, indent: Indentation) -> String;
}
Expand description

Extends the functionality of arrow_schema::Schema.

Required Methods§

Source

fn try_with_column(&self, field: Field) -> Result<Schema, ArrowError>

Create a new Schema with one extra field.

Source

fn try_with_column_at( &self, index: usize, field: Field, ) -> Result<Schema, ArrowError>

Source

fn field_names(&self) -> Vec<&String>

Source

fn without_column(&self, column_name: &str) -> Schema

Source

fn to_compact_string(&self, indent: Indentation) -> String

Create a compact string representation of the schema

This is intended for display purposes and not for serialization

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SchemaExt for Schema

Source§

fn without_column(&self, column_name: &str) -> Schema

Project the schema to remove the given column.

This only works on top-level fields right now. If a field does not exist, the schema will be returned as is.

Source§

fn try_with_column(&self, field: Field) -> Result<Schema, ArrowError>

Source§

fn try_with_column_at( &self, index: usize, field: Field, ) -> Result<Schema, ArrowError>

Source§

fn field_names(&self) -> Vec<&String>

Source§

fn to_compact_string(&self, indent: Indentation) -> String

Implementors§