pub unsafe trait PlainDyn: DynTrait<Plain = Self> {
type Metadata: Copy;
type StaticVTable: Copy;
type LocalNewtype<T>;
}Expand description
A trait object supported by tinydyn.
§Safety
Must be implemented on dyn Trait objects without extra bounds, including lifetimes.
Required Associated Types§
Sourcetype Metadata: Copy
type Metadata: Copy
The metadata carried alongside a Ref and RefMut used to call trait functions.
Sourcetype StaticVTable: Copy
type StaticVTable: Copy
The vtable duplicated for each combination of trait and concrete type.
Sourcetype LocalNewtype<T>
type LocalNewtype<T>
A local generic transparent newtype.
Used to work around the coherence rules by tying in a local newtype.
- Blanket impl for a foreign trait:
BuildDynMetais implemented forLocalNewtype<T>whereTimplements this trait.
§Safety for implementers
- This must be
#[repr(transparent)]overT. - This must not add any additional functionality, excluding that added by
tinydyn.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.