Skip to main content

CustomConverter

Trait CustomConverter 

Source
pub trait CustomConverter {
    type Target: Archive;

    // Required methods
    fn serialize(&self, guard: &ContextGuard<'_>) -> Result<Self::Target>;
    fn deserialize(data: Self::Target, guard: &ContextGuard<'_>) -> Result<Self>
       where Self: Sized;
}
Expand description

A trait for writing custom serialization and deserialization.

#[cacheable(with=Custom)] will use this trait.

Required Associated Types§

Required Methods§

Source

fn serialize(&self, guard: &ContextGuard<'_>) -> Result<Self::Target>

Source

fn deserialize(data: Self::Target, guard: &ContextGuard<'_>) -> Result<Self>
where Self: Sized,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§