Skip to main content

optional

Function optional 

Source
pub fn optional<T, V>(f: impl Fn(T) -> V, value: Option<T>) -> Value
where V: Into<Value>,
Expand description

Encodes an optional Value using the given encoder, if present.