Struct arrow::ffi::FFI_ArrowSchema
#[repr(C)]pub struct FFI_ArrowSchema {
format: *const i8,
name: *const i8,
metadata: *const i8,
flags: i64,
n_children: i64,
children: *mut *mut FFI_ArrowSchema,
dictionary: *mut FFI_ArrowSchema,
release: Option<unsafe extern "C" fn(_: *mut FFI_ArrowSchema)>,
private_data: *mut c_void,
}
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()
}
Fields§
§format: *const i8
§name: *const i8
§metadata: *const i8
§flags: i64
§n_children: i64
§children: *mut *mut FFI_ArrowSchema
§dictionary: *mut FFI_ArrowSchema
§release: Option<unsafe extern "C" fn(_: *mut FFI_ArrowSchema)>
§private_data: *mut c_void
Implementations§
§impl FFI_ArrowSchema
impl FFI_ArrowSchema
pub 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>
pub 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§
§impl Debug for FFI_ArrowSchema
impl Debug for FFI_ArrowSchema
§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.
§impl TryFrom<&DataType> for FFI_ArrowSchema
impl TryFrom<&DataType> for FFI_ArrowSchema
§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.
§impl TryFrom<&FFI_ArrowSchema> for DataType
impl TryFrom<&FFI_ArrowSchema> for DataType
§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.
§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.
§fn try_from(c_schema: &FFI_ArrowSchema) -> Result<Field, ArrowError>
fn try_from(c_schema: &FFI_ArrowSchema) -> Result<Field, ArrowError>
Performs the conversion.
§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.
§fn try_from(c_schema: &FFI_ArrowSchema) -> Result<Schema, ArrowError>
fn try_from(c_schema: &FFI_ArrowSchema) -> Result<Schema, ArrowError>
Performs the conversion.
§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.
§fn try_from(field: &Field) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(field: &Field) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
§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.
§fn try_from(schema: &Schema) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(schema: &Schema) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
§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.
§fn try_from(dtype: DataType) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(dtype: DataType) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
§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.
§fn try_from(field: Field) -> Result<FFI_ArrowSchema, ArrowError>
fn try_from(field: Field) -> Result<FFI_ArrowSchema, ArrowError>
Performs the conversion.
§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.
§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