pub trait HasTempRepr {
type Temp: TempRepr;
type Shared<'a>
where Self: 'a;
// Required methods
fn shared_to_mapped(
obj: Self::Shared<'_>,
) -> <Self::Temp as TempRepr>::Shared<'_>;
fn mapped_to_shared(
mapped: <Self::Temp as TempRepr>::Shared<'_>,
) -> Self::Shared<'_>;
}
Expand description
A safe helper trait for implementing the unsafe TempRepr
and TempReprMut
traits for
a type, by mapping between the type and one with a temporary representation.
The trait must be implemented on some arbitrary type T
; by convention this should be the
same as Self::Mutable<'static>
. Then MappedTempRepr<T>
can be used as the argument of
TempInst
.
Required Associated Types§
Required Methods§
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.