Expand description
This module is a general interface to traitcast
which does not rely on a
global registry. This makes it more flexible at the cost of having to create
a registry and pass it around. If you do not want to do that, use the root
traitcast
module which provides a convenient global registry.
Macros§
- defn_
impl_ entry_ wrapper - Creates a struct named
$wrapper
which wrapsImplEntry<dyn $trait>
for the given$trait
. This is useful because it allows implementing traits on theImplEntry<dyn $trait>
from external modules. This is an implementation detail oftraitcast_to_trait!
. - impl_
entry - Constructs a
ImplEntry
for a trait and a concrete struct implementing that trait.
Structs§
- Cast
Into Trait - Provides methods for casting into the target trait object from other trait objects.
- Impl
Entry - An entry in the table for a particular castable trait. Stores methods to cast into one particular struct that implements the trait.
- Registry
- A registry defining how to cast into some set of traits.
Traits§
- Traitcast
From - Subtraits of
TraitcastFrom
may be cast intodyn Any
, and thus may be cast into any other castable dynamic trait object, too. This is blanket implemented for all sized types with static lifetimes.