Crate rkyv_typename[][src]

Type names for rkyv_dyn.

The goal of TypeName is to avoid allocations if possible. If all you need is the hash of a type name, then there’s no reason to allocate a string to do it.

rkyv_typename provides a derive macro to easily implement TypeName, and has options to easily customize your type’s name.


use rkyv_typename::TypeName;
#[typename = "CoolType"]
struct Example<T>(T);

let mut type_name = String::new();
Example::<i32>::build_type_name(|piece| type_name += piece);
assert_eq!(type_name, "CoolType<i32>");


  • const_generics: Uses the unstable min_const_generics feature to implement array type names (enabled by default)
  • std: Implements TypeName for standard library types (enabled by default)



Builds a name for a type.

Derive Macros


Derives TypeName for the labeled type.