Struct deltalake::arrow::ffi::FFI_ArrowSchema
source · #[repr(C)]pub struct FFI_ArrowSchema { /* private fields */ }
Expand description
ABI-compatible struct for ArrowSchema
from C Data Interface
See https://arrow.apache.org/docs/format/CDataInterface.html#structure-definitions
fn array_schema(data_type: &DataType) -> FFI_ArrowSchema {
FFI_ArrowSchema::try_from(data_type).unwrap()
}
Implementations§
source§impl FFI_ArrowSchema
impl FFI_ArrowSchema
sourcepub fn try_new(
format: &str,
children: Vec<FFI_ArrowSchema>,
dictionary: Option<FFI_ArrowSchema>
) -> Result<FFI_ArrowSchema, ArrowError>
pub fn try_new( format: &str, children: Vec<FFI_ArrowSchema>, dictionary: Option<FFI_ArrowSchema> ) -> Result<FFI_ArrowSchema, ArrowError>
create a new FFI_ArrowSchema
. This fails if the fields’
DataType
is not supported.
pub fn with_name(self, name: &str) -> Result<FFI_ArrowSchema, ArrowError>
pub fn with_flags(self, flags: Flags) -> Result<FFI_ArrowSchema, ArrowError>
pub fn with_metadata<I, S>( self, metadata: I ) -> Result<FFI_ArrowSchema, ArrowError>
sourcepub unsafe fn from_raw(schema: *mut FFI_ArrowSchema) -> FFI_ArrowSchema
pub unsafe fn from_raw(schema: *mut FFI_ArrowSchema) -> FFI_ArrowSchema
Takes ownership of the pointed to FFI_ArrowSchema
This acts to move the data out of schema
, setting the release callback to NULL
§Safety
schema
must be valid for reads and writesschema
must be properly alignedschema
must point to a properly initialized value ofFFI_ArrowSchema
pub fn empty() -> FFI_ArrowSchema
pub fn flags(&self) -> Option<Flags>
pub fn child(&self, index: usize) -> &FFI_ArrowSchema
pub fn children(&self) -> impl Iterator<Item = &FFI_ArrowSchema>
pub fn nullable(&self) -> bool
pub fn dictionary(&self) -> Option<&FFI_ArrowSchema>
pub fn map_keys_sorted(&self) -> bool
pub fn dictionary_ordered(&self) -> bool
pub fn metadata(&self) -> Result<HashMap<String, String>, ArrowError>
Trait Implementations§
source§impl Debug for FFI_ArrowSchema
impl Debug for FFI_ArrowSchema
source§impl Drop for FFI_ArrowSchema
impl Drop for FFI_ArrowSchema
source§impl TryFrom<&Arc<Field>> for FFI_ArrowSchema
impl TryFrom<&Arc<Field>> for FFI_ArrowSchema
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§impl TryFrom<&DataType> for FFI_ArrowSchema
impl TryFrom<&DataType> for FFI_ArrowSchema
source§fn try_from(dtype: &DataType) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(dtype: &DataType) -> Result<FFI_ArrowSchema, ArrowError>
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§impl TryFrom<&FFI_ArrowSchema> for DataType
impl TryFrom<&FFI_ArrowSchema> for DataType
source§fn try_from(c_schema: &FFI_ArrowSchema) -> Result<DataType, ArrowError>
fn try_from(c_schema: &FFI_ArrowSchema) -> Result<DataType, ArrowError>
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§impl TryFrom<&FFI_ArrowSchema> for Field
impl TryFrom<&FFI_ArrowSchema> for Field
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(c_schema: &FFI_ArrowSchema) -> Result<Field, ArrowError>
fn try_from(c_schema: &FFI_ArrowSchema) -> Result<Field, ArrowError>
Performs the conversion.
source§impl TryFrom<&FFI_ArrowSchema> for Schema
impl TryFrom<&FFI_ArrowSchema> for Schema
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(c_schema: &FFI_ArrowSchema) -> Result<Schema, ArrowError>
fn try_from(c_schema: &FFI_ArrowSchema) -> Result<Schema, ArrowError>
Performs the conversion.
source§impl TryFrom<&Field> for FFI_ArrowSchema
impl TryFrom<&Field> for FFI_ArrowSchema
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(field: &Field) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(field: &Field) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
source§impl TryFrom<&Schema> for FFI_ArrowSchema
impl TryFrom<&Schema> for FFI_ArrowSchema
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(schema: &Schema) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(schema: &Schema) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
source§impl TryFrom<DataType> for FFI_ArrowSchema
impl TryFrom<DataType> for FFI_ArrowSchema
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(dtype: DataType) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(dtype: DataType) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
source§impl TryFrom<Field> for FFI_ArrowSchema
impl TryFrom<Field> for FFI_ArrowSchema
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(field: Field) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(field: Field) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
source§impl TryFrom<Schema> for FFI_ArrowSchema
impl TryFrom<Schema> for FFI_ArrowSchema
§type Error = ArrowError
type Error = ArrowError
The type returned in the event of a conversion error.
source§fn try_from(schema: Schema) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(schema: Schema) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
impl Send for FFI_ArrowSchema
Auto Trait Implementations§
impl Freeze for FFI_ArrowSchema
impl RefUnwindSafe for FFI_ArrowSchema
impl !Sync for FFI_ArrowSchema
impl Unpin for FFI_ArrowSchema
impl UnwindSafe for FFI_ArrowSchema
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<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.