Trait mz_persist_types::columnar::FixedSizeCodec
source · 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.
Object Safety§
This trait is not object safe.