downcast_rs::impl_downcast! [] [src]

macro_rules! impl_downcast {
    (@$trait_:ident) => { ... };
    (@$trait_:ident [$($args:ident,)*]) => { ... };
    (@$trait_:ident [$($args:ident,)*] where [$($preds:tt)+]) => { ... };
    (concrete @$trait_:ident [$($args:ident,)*]) => { ... };
    (@impl_body @$trait_:ident [$($args:ident,)*]) => { ... };
    (@as_item $i:item) => { ... };
    ($trait_:ident <>) => { ... };
    ($trait_:ident < $($args:ident),* $(,)* >) => { ... };
    ($trait_:ident) => { ... };
    (concrete $trait_:ident < $($args:ident),* $(,)* >) => { ... };
    ($trait_:ident < $($args:ident),* $(,)* > where $($preds:tt)+) => { ... };
}

Adds downcasting support to traits that extend downcast::Downcast by defining forwarding methods to the corresponding implementations on std::any::Any in the standard library.

See https://users.rust-lang.org/t/how-to-create-a-macro-to-impl-a-provided-type-parametrized-trait/5289 for why this is implemented this way to support templatized traits.