rust-sen/sehn/examples/basic.rs

20 lines
291 B
Rust
Raw Normal View History

2018-12-18 11:20:06 +00:00
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::to_string(&val).unwrap());
}