Trait snapbox::data::IntoJson

source ·
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);

Required Methods§

source

fn into_json(self) -> Data

Implementors§