[−][src]Struct vptr::ThinRef
A thin reference (size = size_of::<usize>()
) to an object implementing the trait Trait
This is like a reference to a trait (&dyn Trait
) for struct that used
the macro #[vptr(Trait)]
See the crate documentation for example of usage.
The size is only the size of a single pointer:
assert_eq!(mem::size_of::<ThinRef<dyn Trait>>(), mem::size_of::<usize>()); assert_eq!(mem::size_of::<Option<ThinRef<dyn Trait>>>(), mem::size_of::<usize>());
Trait Implementations
impl<'a, Trait: ?Sized> Clone for ThinRef<'a, Trait>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, Trait: ?Sized + 'a, T: HasVPtr<Trait>> From<&'a T> for ThinRef<'a, Trait>
[src]
impl<'a, Trait: ?Sized> Copy for ThinRef<'a, Trait>
[src]
impl<'a, Trait: ?Sized + 'a> Deref for ThinRef<'a, Trait>
[src]
impl<'a, Trait: ?Sized + 'a> Borrow<Trait> for ThinRef<'a, Trait>
[src]
Auto Trait Implementations
impl<'a, Trait: ?Sized> Send for ThinRef<'a, Trait> where
Trait: Sync,
Trait: Sync,
impl<'a, Trait: ?Sized> Unpin for ThinRef<'a, Trait>
impl<'a, Trait: ?Sized> Sync for ThinRef<'a, Trait> where
Trait: Sync,
Trait: Sync,
impl<'a, Trait: ?Sized> RefUnwindSafe for ThinRef<'a, Trait> where
Trait: RefUnwindSafe,
Trait: RefUnwindSafe,
impl<'a, Trait: ?Sized> UnwindSafe for ThinRef<'a, Trait> where
Trait: RefUnwindSafe,
Trait: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,