Trait arrow2::types::NativeType
source · [−]pub trait NativeType: Sealed + Pod + Send + Sync + Sized + Debug + Display + PartialEq + Default {
type Bytes: AsRef<[u8]> + Index<usize, Output = u8> + IndexMut<usize, Output = u8> + for<'a> TryFrom<&'a [u8]> + Debug + Default;
const PRIMITIVE: PrimitiveType;
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
Required Associated Constants
const PRIMITIVE: PrimitiveType
const PRIMITIVE: PrimitiveType
The corresponding variant of PrimitiveType
.
Required Methods
fn to_le_bytes(&self) -> Self::Bytes
fn to_le_bytes(&self) -> Self::Bytes
To bytes in little endian
fn to_be_bytes(&self) -> Self::Bytes
fn to_be_bytes(&self) -> Self::Bytes
To bytes in big endian
fn from_le_bytes(bytes: Self::Bytes) -> Self
fn from_le_bytes(bytes: Self::Bytes) -> Self
From bytes in little endian
fn from_be_bytes(bytes: Self::Bytes) -> Self
fn from_be_bytes(bytes: Self::Bytes) -> Self
From bytes in big endian