Kind

Macro Kind 

Source
Kind!() { /* proc-macro */ }
Expand description

Generates the name of a Kind trait based on its signature.

This macro takes a list of associated type definitions, similar to a trait definition.

§Examples

// Simple signature
let name = Kind!(type Of<T>;);

// Signature with bounds and lifetimes
let name = Kind!(type Of<'a, T: Display>: Debug;);

// Multiple associated types
let name = Kind!(
    type Of<T>;
    type SendOf<T>: Send;
);

§Limitations

Due to Rust syntax restrictions, this macro cannot be used directly in positions where a concrete path is expected by the parser, such as:

  • Supertrait bounds: trait MyTrait: Kind!(...) {} (Invalid)
  • Type aliases: type MyKind = Kind!(...); (Invalid)
  • Trait aliases: trait MyKind = Kind!(...); (Invalid)

In these cases, you must use the generated name directly (e.g., Kind_...).