pub trait TryAsDynCompatible<'a>: Pointee<Metadata = DynMetadata<Self>> { }🔬This is a nightly-only experimental API. (
try_as_dyn #144361)Expand description
Trait that is automatically implemented for all dyn Trait<'b, C> + 'a without assoc type bounds.
The lifetime parameter should be the same that is used to constrain generic type parameters
that are turned into the dyn trait constrained by TryAsDynCompatible.
This is required for try_as_dyn to be able to soundly convert non-static
types to dyn Trait.
Note: these requirements are sufficient for soundness, but it is unclear if they are all necessary. We may be able to lift some requirements in favor of more precise ones.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".