pub trait IntoJson {
// Required method
fn into_json(self) -> Data;
}
Available on crate feature
json
only.Expand description
Capture the serde representation of a value
§Examples
use snapbox::IntoJson as _;
fn some_function() -> usize {
// ...
}
let actual = some_function();
let expected = snapbox::str![["5"]];
snapbox::assert_data_eq!(actual.into_json(), expected);