pub trait ConvertValue<T>where
    Self: Sized,{
    // Required methods
    fn convert(&self, convert: &Option<Conversion>) -> Result<T>;
    fn unconvert(val: &T) -> Result<Self>;
}
Expand description

Trait to implement conversion from the raw (h)json data to structured data. This is used to implement variable substitution in Subst.

Required Methods§

source

fn convert(&self, convert: &Option<Conversion>) -> Result<T>

Convert from fraw data to structured data (i.e. deserialize). Optionally provide an indication of how the data should first be parsed and how it should be converted to the type T.

source

fn unconvert(val: &T) -> Result<Self>

Convert from structured data to raw data (i.e. serialize). The returned value shall satisfy that if then converted using convert(None, None) then it should return the same value.

Implementors§