Skip to main content

AttributeCoder

Trait AttributeCoder 

Source
pub trait AttributeCoder: Send + Sync {
    // Required methods
    fn dump(&self, value: &Value) -> Result<String, SerializationError>;
    fn load(&self, raw: &str) -> Result<Value, SerializationError>;
}
Expand description

Serializer contract for JSON-backed custom coders.

Required Methods§

Source

fn dump(&self, value: &Value) -> Result<String, SerializationError>

Serializes a JSON value into a database column string.

Source

fn load(&self, raw: &str) -> Result<Value, SerializationError>

Deserializes a database column string into JSON.

Implementors§