serde-typeinfo

"Serialize" type info to a runtime tag based on serde data model.

Examples

```rust use serde_typeinfo::{TypeTag, Primitive};

asserteq!( TypeTag::fromvalue(&32_u8), TypeTag::Primitive(Primitive::U8), // only tag, not includes 32 ); ```

```rust use serde_typeinfo::{TypeTag, Primitive}; use serde::Serialize;

[derive(Serialize)]

struct A { a: u8, b: u8, }

asserteq!( TypeTag::fromvalue(&A { a: 2, b: 3 }), TypeTag::Struct { name: "A", fields: vec![ ("a", Primitive::U8.into()), ("b", Primitive::U8.into()), ] } ); ```

License

© 2023 Toshiki Teramura (@termoshtt)

This project is licensed under either of

at your option.