This crate provides a fast and reliable way to extract the Serde name of a Rust container.
#[derive(Deserialize)]
struct Foo {
bar: Bar,
}
#[derive(Deserialize)]
#[serde(rename = "ABC")]
enum Bar { A, B, C }
assert_eq!(trace_name::<Foo>(), Some("Foo"));
assert_eq!(trace_name::<Bar>(), Some("ABC"));
assert_eq!(trace_name::<Option<Bar>>(), None);
See the CONTRIBUTING file for how to help out.
This project is available under the terms of either the Apache 2.0 license or the MIT license.