Trait polars_arrow::types::NativeType

source ·
pub trait NativeType: Sealed + Pod + Send + Sync + Sized + RefUnwindSafe + Debug + Display + PartialEq + Default + Copy + TotalOrd + IsNull + MinMax {
    type Bytes: AsRef<[u8]> + AsMut<[u8]> + Index<usize, Output = u8> + IndexMut<usize, Output = u8> + for<'a> TryFrom<&'a [u8]> + Debug + Default + IntoIterator<Item = u8>;

    const PRIMITIVE: PrimitiveType;

    // Required methods
    fn to_le_bytes(&self) -> Self::Bytes;
    fn to_be_bytes(&self) -> Self::Bytes;
    fn from_le_bytes(bytes: Self::Bytes) -> Self;
    fn from_be_bytes(bytes: Self::Bytes) -> Self;
}
Expand description

Sealed trait implemented by all physical types that can be allocated, serialized and deserialized by this crate. All O(N) allocations in this crate are done for this trait alone.

Required Associated Types§

source

type Bytes: AsRef<[u8]> + AsMut<[u8]> + Index<usize, Output = u8> + IndexMut<usize, Output = u8> + for<'a> TryFrom<&'a [u8]> + Debug + Default + IntoIterator<Item = u8>

Type denoting its representation as bytes. This is [u8; N] where N = size_of::<T>.

Required Associated Constants§

source

const PRIMITIVE: PrimitiveType

The corresponding variant of PrimitiveType.

Required Methods§

source

fn to_le_bytes(&self) -> Self::Bytes

To bytes in little endian

source

fn to_be_bytes(&self) -> Self::Bytes

To bytes in big endian

source

fn from_le_bytes(bytes: Self::Bytes) -> Self

From bytes in little endian

source

fn from_be_bytes(bytes: Self::Bytes) -> Self

From bytes in big endian

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl NativeType for f32

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Float32

§

type Bytes = [u8; 4]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for f64

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Float64

§

type Bytes = [u8; 8]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for i8

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int8

§

type Bytes = [u8; 1]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for i16

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int16

§

type Bytes = [u8; 2]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for i32

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int32

§

type Bytes = [u8; 4]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for i64

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int64

§

type Bytes = [u8; 8]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for i128

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int128

§

type Bytes = [u8; 16]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for u8

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt8

§

type Bytes = [u8; 1]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for u16

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt16

§

type Bytes = [u8; 2]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for u32

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt32

§

type Bytes = [u8; 4]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for u64

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt64

§

type Bytes = [u8; 8]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

source§

impl NativeType for u128

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt128

§

type Bytes = [u8; 16]

source§

fn to_le_bytes(&self) -> Self::Bytes

source§

fn to_be_bytes(&self) -> Self::Bytes

source§

fn from_le_bytes(bytes: Self::Bytes) -> Self

source§

fn from_be_bytes(bytes: Self::Bytes) -> Self

Implementors§

source§

impl NativeType for View

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt128

§

type Bytes = [u8; 16]

source§

impl NativeType for days_ms

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::DaysMs

§

type Bytes = [u8; 8]

source§

impl NativeType for f16

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Float16

§

type Bytes = [u8; 2]

source§

impl NativeType for i256

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int256

§

type Bytes = [u8; 32]

source§

impl NativeType for months_days_ns

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::MonthDayNano

§

type Bytes = [u8; 16]