pub trait FixedSizeCodec<T>:
Debug
+ PartialEq
+ Eq {
const SIZE: usize;
// Required methods
fn as_bytes(&self) -> &[u8] ⓘ;
fn from_bytes(val: &[u8]) -> Result<Self, String>
where Self: Sized;
fn from_value(value: T) -> Self;
fn into_value(self) -> T;
}
Expand description
A stable encoding for a type that gets durably persisted in an
arrow::array::FixedSizeBinaryArray
.
Required Associated Constants§
Required Methods§
Sourcefn from_bytes(val: &[u8]) -> Result<Self, String>where
Self: Sized,
fn from_bytes(val: &[u8]) -> Result<Self, String>where
Self: Sized,
Create an instance of self
from a slice.
Note: It is the responsibility of the caller to make sure the provided
data is valid for self
.
Sourcefn from_value(value: T) -> Self
fn from_value(value: T) -> Self
Encode a type of T
into this format.
Sourcefn into_value(self) -> T
fn into_value(self) -> T
Decode an instance of T
from this format.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.