[][src]Macro cast_trait_object::impl_dyn_cast

macro_rules! impl_dyn_cast {
    (
        // Declare generic lifetimes and type parameters
        for<$($lifetime:lifetime),* $($generics:ident),* $(,)?>
        // Path to self type:
        $self_type:ty
        as
        // Path to the source trait we are casting from:
        $source_trait:path
        // Where clause:
        $(where { $($where:tt)* })?
        =>
        // Path to config type:
        $target_trait:path
    ) => { ... };
    (
        // Declare generic lifetimes and type parameters
        for<$($lifetime:lifetime),* $($generics:ident),* $(,)?>
        // Path to self type:
        $self_type:ty
        // Where clause:
        $(where { $($where:tt)* })?
        =>
        // Path to config type:
        $config_type:ty
    ) => { ... };
    ($self_type:ty as $source_trait:path => $($target_trait:path),*) => { ... };
    ($self_type:ty => $($config_type:ty),*) => { ... };
}

Implement the DynCast trait for a type to cast from a specific trait object to a specified different trait object.