rust-sen/sehn-serde/examples/basic.rs
2019-01-20 14:24:19 +00:00

20 lines
297 B
Rust

use serde_derive::Serialize;
#[derive(Serialize)]
pub struct UserType<T>(T);
#[derive(Serialize)]
pub struct Test<'a> {
foo: &'a str,
bar: UserType<&'a str>
}
fn main() {
let val = Test {
foo: "hello",
bar: UserType("world")
};
println!("{}", sehn_serde::to_string(&val).unwrap());
}