This crate provides fast and reliable ways to extract and to override the Serde name of a Rust container.
Name extraction relies on the Deserialize trait of Serde:
```rust
struct Foo { bar: Bar, }
enum Bar { A, B, C }
asserteq!(tracename::
SerializeNameAdapter
and DeserializeNameAdapter
may be used to override the name
of a container in the cases where #[serde(rename = "..")]
is not flexible enough.
```rust
struct Foo
impl<'de, T> Deserialize<'de> for Foo
impl(&self, serializer: S) -> Result
// Testing the Deserialize implementation
assert!(tracename::
// Testing the Serialize implementation
use serdereflection::*;
let mut tracer = Tracer::new(TracerConfig::default());
let mut samples = Samples::new();
let (mut ident, _) = tracer.tracevalue(&mut samples, &Foo { data: 1u64 }).unwrap();
ident.normalize().unwrap();
assert!(matches!(ident, Format::TypeName(s) if s.ends_with("Foo
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.