Trait wyz::comu::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.

Object Safety§

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,

§

type Ref = &'a T

source§

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

§

type Ref = &'a T

source§

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