Trait re_sdk::external::arrow2::types::NativeType

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

    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]> + Index<usize, Output = u8, Output = u8> + IndexMut<usize> + for<'a> TryFrom<&'a [u8]> + Debug + Default

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) -> <f32 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <f32 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <f32 as NativeType>::Bytes) -> f32

source§

fn from_be_bytes(bytes: <f32 as NativeType>::Bytes) -> f32

source§

impl NativeType for f64

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Float64

§

type Bytes = [u8; 8]

source§

fn to_le_bytes(&self) -> <f64 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <f64 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <f64 as NativeType>::Bytes) -> f64

source§

fn from_be_bytes(bytes: <f64 as NativeType>::Bytes) -> f64

source§

impl NativeType for i8

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int8

§

type Bytes = [u8; 1]

source§

fn to_le_bytes(&self) -> <i8 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <i8 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <i8 as NativeType>::Bytes) -> i8

source§

fn from_be_bytes(bytes: <i8 as NativeType>::Bytes) -> i8

source§

impl NativeType for i16

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int16

§

type Bytes = [u8; 2]

source§

fn to_le_bytes(&self) -> <i16 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <i16 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <i16 as NativeType>::Bytes) -> i16

source§

fn from_be_bytes(bytes: <i16 as NativeType>::Bytes) -> i16

source§

impl NativeType for i32

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int32

§

type Bytes = [u8; 4]

source§

fn to_le_bytes(&self) -> <i32 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <i32 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <i32 as NativeType>::Bytes) -> i32

source§

fn from_be_bytes(bytes: <i32 as NativeType>::Bytes) -> i32

source§

impl NativeType for i64

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::Int64

§

type Bytes = [u8; 8]

source§

fn to_le_bytes(&self) -> <i64 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <i64 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <i64 as NativeType>::Bytes) -> i64

source§

fn from_be_bytes(bytes: <i64 as NativeType>::Bytes) -> i64

source§

impl NativeType for i128

source§

impl NativeType for u8

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt8

§

type Bytes = [u8; 1]

source§

fn to_le_bytes(&self) -> <u8 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <u8 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <u8 as NativeType>::Bytes) -> u8

source§

fn from_be_bytes(bytes: <u8 as NativeType>::Bytes) -> u8

source§

impl NativeType for u16

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt16

§

type Bytes = [u8; 2]

source§

fn to_le_bytes(&self) -> <u16 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <u16 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <u16 as NativeType>::Bytes) -> u16

source§

fn from_be_bytes(bytes: <u16 as NativeType>::Bytes) -> u16

source§

impl NativeType for u32

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt32

§

type Bytes = [u8; 4]

source§

fn to_le_bytes(&self) -> <u32 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <u32 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <u32 as NativeType>::Bytes) -> u32

source§

fn from_be_bytes(bytes: <u32 as NativeType>::Bytes) -> u32

source§

impl NativeType for u64

source§

const PRIMITIVE: PrimitiveType = PrimitiveType::UInt64

§

type Bytes = [u8; 8]

source§

fn to_le_bytes(&self) -> <u64 as NativeType>::Bytes

source§

fn to_be_bytes(&self) -> <u64 as NativeType>::Bytes

source§

fn from_le_bytes(bytes: <u64 as NativeType>::Bytes) -> u64

source§

fn from_be_bytes(bytes: <u64 as NativeType>::Bytes) -> u64

Implementors§

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]