wyz::comu

Trait Referential

Source
pub trait Referential<'a>: Sealed {
    type Ref: 'a + Deref;

    // Required methods
    unsafe fn to_ref(self) -> Self::Ref;
    fn from_ref(this: Self::Ref) -> Self;
}
Expand description

Allows an Address to produce an ordinary reference.

Required Associated Types§

Source

type Ref: 'a + Deref

The created reference type. Must be one of &T or &mut T.

Required Methods§

Source

unsafe fn to_ref(self) -> Self::Ref

Converts the Address to a reference.

§Safety

The caller is responsible for ensuring that the memory location that the Address describes contains an initialized value, and that the produced reference abides by the Rust &/&mut exclusion rules.

Source

fn from_ref(this: Self::Ref) -> Self

Converts a reference back into an Address.

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§

Source§

impl<'a, M, T> Referential<'a> for Address<Frozen<M>, T>
where M: Mutability, T: 'a + ?Sized,

Source§

impl<'a, T> Referential<'a> for Address<Const, T>
where T: 'a + ?Sized,

Source§

impl<'a, T> Referential<'a> for Address<Mut, T>
where T: 'a + ?Sized,