ot_certs::template::subst

Trait ConvertValue

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§