pub fn to_value<T>(value: T) -> Result<Value, Error> where
    T: Serialize
Expand description

Convert a T into rmpv::Value which is an enum that can represent any valid MessagePack data.

This conversion can fail if T’s implementation of Serialize decides to fail.


let val = rmpv::ext::to_value("John Smith").unwrap();

assert_eq!(Value::String("John Smith".into()), val);