[−][src]Trait vessels::format::Format
A serialization format used in the transport of Kind
s.
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.
Required methods
fn serialize<T: Serialize>(item: T) -> Self::Representation where
Self: Sized,
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,
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.
Implementors
impl Format for Bincode
[src]
type Representation = Vec<u8>
type Error = Error
fn serialize<T: Serialize>(item: T) -> Self::Representation
[src]
fn deserialize<'de, T: DeserializeSeed<'de>>(
item: Self::Representation,
context: T
) -> Fallible<T::Value, (Self::Error, Self::Representation)> where
T: Sync + Send + 'static,
[src]
item: Self::Representation,
context: T
) -> Fallible<T::Value, (Self::Error, Self::Representation)> where
T: Sync + Send + 'static,
impl Format for Cbor
[src]
type Representation = Vec<u8>
type Error = Error
fn serialize<T: Serialize>(item: T) -> Self::Representation
[src]
fn deserialize<'de, T: DeserializeSeed<'de>>(
item: Self::Representation,
context: T
) -> Fallible<T::Value, (Self::Error, Self::Representation)> where
T: Sync + Send + 'static,
[src]
item: Self::Representation,
context: T
) -> Fallible<T::Value, (Self::Error, Self::Representation)> where
T: Sync + Send + 'static,
impl Format for Json
[src]
type Representation = String
type Error = Error
fn serialize<T: Serialize>(item: T) -> Self::Representation
[src]
fn deserialize<'de, T: DeserializeSeed<'de>>(
item: Self::Representation,
context: T
) -> Fallible<T::Value, (Self::Error, Self::Representation)> where
T: Sync + Send + 'static,
[src]
item: Self::Representation,
context: T
) -> Fallible<T::Value, (Self::Error, Self::Representation)> where
T: Sync + Send + 'static,