Skip to main content

Serialise

Trait Serialise 

Source
pub trait Serialise<C>: Sized {
    type Error;

    // Required methods
    fn encode(&self) -> Result<Vec64<u8>, Self::Error>;
    fn decode(bytes: &[u8]) -> Result<Self, Self::Error>;

    // Provided method
    fn decode_owned(bytes: Vec64<u8>) -> Result<Self, Self::Error> { ... }
}
Expand description

Encodes and decodes a value using codec C.

Required Associated Types§

Source

type Error

Error returned by encoding or decoding.

Required Methods§

Source

fn encode(&self) -> Result<Vec64<u8>, Self::Error>

Encodes this value into a self-contained byte buffer.

Source

fn decode(bytes: &[u8]) -> Result<Self, Self::Error>

Decodes a value from a borrowed byte slice.

Provided Methods§

Source

fn decode_owned(bytes: Vec64<u8>) -> Result<Self, Self::Error>

Decodes a value from an owned byte buffer.

The default implementation delegates to Self::decode. Codecs may override this method when they can consume the buffer without copying.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for Array

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for BooleanArray<()>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for CategoricalArray<u8>

Available on crate feature default_categorical_8 only.
Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for FieldArray

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for FloatArray<f32>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for FloatArray<f64>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for IntegerArray<i32>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for IntegerArray<i64>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for IntegerArray<u32>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for IntegerArray<u64>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for NumericArray

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for StringArray<u32>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for StringArray<u64>

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for SuperArray

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for SuperTable

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for Table

Source§

impl Serialise<ArrowIpcCodec<Vec64<u8>>> for TextArray

Implementors§