[][src]Trait track::serialization::SerializationStrategy

pub trait SerializationStrategy: Clone + Default + Send + Sync {
    fn serialize<I: Serialize>(&self, input: &I) -> Result<Vec<u8>, ErrorKind>;
fn deserialize<'a, T: Deserialize<'a>>(
        &self,
        buffer: &'a [u8]
    ) -> Result<T, ErrorKind>;
fn apply_to<C: SerdeDiff>(
        &self,
        component: &mut C,
        data: &[u8]
    ) -> Result<(), ErrorKind>; }

An adapter interface with extension methods for serializing purposes used in this crate.

Required methods

fn serialize<I: Serialize>(&self, input: &I) -> Result<Vec<u8>, ErrorKind>

Serializes the given type to a byte buffer.

fn deserialize<'a, T: Deserialize<'a>>(
    &self,
    buffer: &'a [u8]
) -> Result<T, ErrorKind>

Deserializes the given byte buffer to the desired type.

fn apply_to<C: SerdeDiff>(
    &self,
    component: &mut C,
    data: &[u8]
) -> Result<(), ErrorKind>

Applies the given byte buffer to the given type. The buffer contains the data of the modified fields sent with the ModificationEvent.

Loading content...

Implementors

impl SerializationStrategy for Bincode[src]

Loading content...