pub unsafe trait Zonbi<'life>: 'life {
type Casted: Sized + Zonbi<'life>;
// Required methods
fn zonbi_id() -> ZonbiId;
unsafe fn zonbify(self) -> Self::Casted;
unsafe fn zonbify_ref(&self) -> &Self::Casted;
unsafe fn zonbify_mut(&mut self) -> &mut Self::Casted;
}
Expand description
A trait to make a 'life
-lifetimed version of a type.
It is unsafe to implement because we can’t assure that the Casted
associated type
is the “same” (ignoring lifetimes) as the implementor.
Required Associated Types§
Required Methods§
unsafe fn zonbify(self) -> Self::Casted
unsafe fn zonbify_ref(&self) -> &Self::Casted
unsafe fn zonbify_mut(&mut self) -> &mut Self::Casted
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.