[][src]Trait vessels::format::Format

pub trait Format {
    type Representation;
    type Error: ErrorBound;
    fn serialize<T: Serialize>(item: T) -> Self::Representation
    where
        Self: Sized
;
fn deserialize<'de, T: DeserializeSeed<'de>>(
        item: Self::Representation,
        context: T
    ) -> Fallible<T::Value, (Self::Error, Self::Representation)>
    where
        T: Sync + Send + 'static,
        Self: Sized
; }

A serialization format used in the transport of Kinds.

This is generally a minimal wrapper that encapsulates a serde format.

Associated Types

type Representation

The underlying representation used by this Format, i.e. Vec<u8> for most binary formats and String for those of a human-readable nature.

type Error: ErrorBound

The failure condition of this format. This may be encountered during deserialization.

Loading content...

Required methods

fn serialize<T: Serialize>(item: T) -> Self::Representation where
    Self: Sized

Serializes the provided item.

fn deserialize<'de, T: DeserializeSeed<'de>>(
    item: Self::Representation,
    context: T
) -> Fallible<T::Value, (Self::Error, Self::Representation)> where
    T: Sync + Send + 'static,
    Self: Sized

Deserializes an item from the provided formatted representation.

Loading content...

Implementors

impl Format for Bincode[src]

type Representation = Vec<u8>

type Error = Error

impl Format for Cbor[src]

type Representation = Vec<u8>

type Error = Error

impl Format for Json[src]

type Representation = String

type Error = Error

Loading content...