[][src]Struct user_stable_vtable::refs::StableRef

#[repr(C)]pub struct StableRef<'a, Trait: StableVTableTrait + ?Sized> { /* fields omitted */ }

A type-erased pointer with stable layout to a trait object This pointer has the same layout as &dyn Trait for #[stable_vtable] traits as with [RFC 2955]. Note: While &T has special handling when inside Option<T>, no such guarantee is stably made. There are test suites that check to ensure this is correct.

Also Note: Specifically, this implementation imposes a restriction that the VTable reference be valid for reading for 'a. It is not yet specified the required validity of the vtable

Trait Implementations

impl<Trait: StableVTableTrait + StablePointerCast<StablePtr<Trait>> + ?Sized, '_> Deref for StableRef<'_, Trait>[src]

type Target = Trait

The resulting type after dereferencing.

impl<'a, 'b: 'a, Trait: StableVTableTrait + ?Sized> From<StableMut<'b, Trait>> for StableRef<'a, Trait>[src]

impl<'a, Trait: StableVTableTrait + ?Sized> StableReference<'a, Trait> for StableRef<'a, Trait>[src]

type Pointer = StablePtr<Trait>

Auto Trait Implementations

impl<'a, Trait> !Send for StableRef<'a, Trait>

impl<'a, Trait> !Sync for StableRef<'a, Trait>

impl<'a, Trait: ?Sized> Unpin for StableRef<'a, Trait>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.