impl_kind

Macro impl_kind 

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

Implements a Kind trait for a brand.

This macro simplifies the implementation of a generated Kind trait for a specific brand type. It infers the correct Kind trait to implement based on the signature of the associated type Of.

§Syntax

impl_kind! {
    impl<GENERICS> for BrandType {
        type Of<PARAMS> = ConcreteType;
    }
}

Or with where clause:

impl_kind! {
    impl<E> for ResultBrand<E> where E: Debug {
        type Of<A> = Result<A, E>;
    }
}

§Example

impl_kind! {
    for OptionBrand {
        type Of<A> = Option<A>;
    }
}