Expand description
Serialize any type implementing Facet into a facet_value::Value.
This crate hosts the adapter between facet-format’s event serializer model
and facet-value’s dynamic Value type.
§Example
use facet::Facet;
use facet_value::{Value, from_value};
use facet_value_format::to_value;
#[derive(Debug, Facet, PartialEq)]
struct Person {
name: String,
age: u32,
}
let person = Person { name: "Alice".into(), age: 30 };
let value: Value = to_value(&person).unwrap();
let person2: Person = from_value(value).unwrap();
assert_eq!(person, person2);Structs§
- ToValue
Error - Error type for
Valueserialization.
Functions§
- peek_
to_ value - Serialize a
Peekinstance into aValue. - to_
value - Serialize a value implementing
Facetinto aValue.