[−][src]Struct user_stable_vtable::refs::StableRef
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.
pub fn deref(&self) -> &Self::Target
[src]
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>
pub fn size_of_val(&self) -> usize where
Trait: 'a,
[src]
Trait: 'a,
pub fn align_of_val(&self) -> usize where
Trait: 'a,
[src]
Trait: 'a,
pub fn into_raw(self) -> Self::Pointer
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,