[][src]Crate traitcast_core

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.



Creates a struct named $wrapper which wraps ImplEntry<dyn $trait> for the given $trait. This is useful because it allows implementing traits on the ImplEntry<dyn $trait> from external modules. This is an implementation detail of traitcast_to_trait!.


Constructs a ImplEntry for a trait and a concrete struct implementing that trait.



Provides methods for casting into the target trait object from other trait objects.


An entry in the table for a particular castable trait. Stores methods to cast into one particular struct that implements the trait.


A registry defining how to cast into some set of traits.



Subtraits of TraitcastFrom may be cast into dyn 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.