use serde_derive::Serialize; #[derive(Serialize)] pub struct UserType(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()); }