Trait arrow::alloc::NativeType[][src]

pub unsafe trait NativeType: Sized + Copy + Debug + Display + PartialEq + Default + Sized + 'static {
    type Bytes: AsRef<[u8]>;
    fn is_valid(data_type: &DataType) -> bool;
fn to_le_bytes(&self) -> Self::Bytes; }
Expand description

A type that Rust’s custom allocator knows how to allocate and deallocate. This is implemented for all Arrow’s physical types whose in-memory representation matches Rust’s physical types. Consider this trait sealed.

Safety

Do not implement this trait.

Associated Types

Required methods

fn is_valid(data_type: &DataType) -> bool[src]

Whether a DataType is a valid type for this physical representation.

fn to_le_bytes(&self) -> Self::Bytes[src]

How this type represents itself as bytes in little endianess. This is used for IPC, where data is communicated with a specific endianess.

Implementations on Foreign Types

impl NativeType for u8[src]

type Bytes = [u8; 1]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for u16[src]

type Bytes = [u8; 2]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for u32[src]

type Bytes = [u8; 4]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for u64[src]

type Bytes = [u8; 8]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for i8[src]

type Bytes = [u8; 1]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for i16[src]

type Bytes = [u8; 2]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for i32[src]

type Bytes = [u8; 4]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for i64[src]

type Bytes = [u8; 8]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for f32[src]

type Bytes = [u8; 4]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

impl NativeType for f64[src]

type Bytes = [u8; 8]

fn to_le_bytes(&self) -> Self::Bytes[src]

fn is_valid(data_type: &DataType) -> bool[src]

Implementors