Macro alga::impl_marker [] [src]

macro_rules! impl_marker {
    (@para_rec
        [$tra1t:ty, ($($clause:tt)+), ($($type_constr:tt)*)]
        (< $($params:tt)*)
    ) => { ... };
    (@para_rec
        [$tra1t:ty, ($($clause:tt)+), ($($prev:tt)*)]
        ($cur:tt $($rest:tt)*)
    ) => { ... };
    (@where_rec
        [$tra1t:ty, ($($typ3:tt)+), ($($clause:tt)+)]
        ($(;)*)
    ) => { ... };
    (@where_rec
        [$tra1t:ty, ($($typ3:tt)+), ($($clause:tt)+)]
        (; $($rest:tt)+)
    ) => { ... };
    (@where_rec
        [$tra1t:ty, ($($typ3:tt)+), ($($prev:tt)*)]
        ($cur:tt $($rest:tt)*)
    ) => { ... };
    (@rec
        [$tra1t:ty, ($($typ3:tt)*)]
        ($(;)*)
    ) => { ... };
    (@rec
        [$tra1t:ty, ($($typ3:tt)*)]
        (; $($rest:tt)+)
    ) => { ... };
    (@rec
        [$tra1t:ty, ($($prev:tt)+)]
        (where $($rest:tt)+)
    ) => { ... };
    (@rec
        [$tra1t:ty, ($($prev:tt)*)]
        ($cur:tt $($rest:tt)*)
    ) => { ... };
    ($tra1t:ty; $($rest:tt)+) => { ... };
}

Implements empty traits aka marker traits for types provided.

Examples

trait Marker {}
struct Struct;
impl_marker!(Marker; u32; Struct);
trait Marker<T: Debug> {}
struct Struct<T>(T);
impl_marker!(Marker<T>; Struct<T> where T: Debug);