PlainDyn

Trait PlainDyn 

Source
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§

Source

type Metadata: Copy

The metadata carried alongside a Ref and RefMut used to call trait functions.

Source

type StaticVTable: Copy

The vtable duplicated for each combination of trait and concrete type.

Source

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: BuildDynMeta is implemented for LocalNewtype<T> where T implements this trait.
§Safety for implementers
  • This must be #[repr(transparent)] over T.
  • 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.

Implementors§