[][src]Struct dync::CopyValueRef

pub struct CopyValueRef<'a, V = ()> where
    V: ?Sized
{ /* fields omitted */ }

A generic value reference to a Copy type.

Implementations

impl<'a, V> CopyValueRef<'a, V>[src]

pub fn new<T: CopyElem>(typed: &'a T) -> CopyValueRef<'a, V> where
    V: VTable<T>, 
[src]

Create a new CopyValueRef from a typed reference.

impl<'a, V: ?Sized> CopyValueRef<'a, V>[src]

pub fn size(&self) -> usize[src]

Get the size of the value pointed-to by this reference.

pub fn value_type_id(&self) -> TypeId[src]

Get the TypeId of the referenced value.

pub fn value_alignment(&self) -> usize[src]

Get the alignment of the referenced value.

pub fn is<T: 'static>(&self) -> bool[src]

Returns true if this referenced value's type is the same as T.

pub fn downcast<T: CopyElem>(self) -> Option<&'a T>[src]

Downcast this value reference into a borrowed T type. Return None if the downcast fails.

pub fn upcast<U: ?Sized + From<V>>(self) -> CopyValueRef<'a, U> where
    V: Clone
[src]

pub fn upcast_ref<U: ?Sized + From<V>>(&self) -> CopyValueRef<'_, U> where
    V: Clone
[src]

Trait Implementations

impl<'a, V> Clone for CopyValueRef<'a, V> where
    V: Clone + ?Sized
[src]

impl<'a, V: ?Sized + HasDebug> Debug for CopyValueRef<'a, V>[src]

impl<'a, V: ?Sized + HasEq> Eq for CopyValueRef<'a, V>[src]

impl<'a, V: ?Sized + 'a> Extend<CopyValueRef<'a, V>> for VecCopy<V>[src]

impl<'a, V> From<CopyValueMut<'a, V>> for CopyValueRef<'a, V>[src]

impl<'a, V> From<CopyValueRef<'a, V>> for Meta<VTableRef<'a, V>>[src]

impl<'a, V: Any + Clone> From<CopyValueRef<'a, V>> for ValueRef<'a, (DropFn, V)>[src]

impl<'a, V: Clone + ?Sized + 'a> FromIterator<CopyValueRef<'a, V>> for VecCopy<V>[src]

fn from_iter<T: IntoIterator<Item = CopyValueRef<'a, V>>>(iter: T) -> Self[src]

Construct a VecCopy type from a non-empty iterator.

Panics

This function will panic if the given iterator is empty. This is because we don't know the element types until we see one since the types are erased in both CopyValueRef and VecCopy.

impl<'a, V: ?Sized + HasHash> Hash for CopyValueRef<'a, V>[src]

impl<'a, V: ?Sized + HasPartialEq> PartialEq<CopyValueRef<'a, V>> for CopyValueRef<'a, V>[src]

impl<'a, V: ?Sized + HasSend> Send for CopyValueRef<'a, V>[src]

impl<'a, V: ?Sized + HasSync> Sync for CopyValueRef<'a, V>[src]

Auto Trait Implementations

impl<'a, V: ?Sized> RefUnwindSafe for CopyValueRef<'a, V> where
    V: RefUnwindSafe

impl<'a, V: ?Sized> Unpin for CopyValueRef<'a, V>

impl<'a, V: ?Sized> UnwindSafe for CopyValueRef<'a, V> where
    V: RefUnwindSafe + UnwindSafe

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> CloneBytes for T where
    T: 'static + Clone
[src]

impl<T> DebugBytes for T where
    T: 'static + Debug
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> DropBytes for T where
    T: 'static, 
[src]

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

impl<T> HashBytes for T where
    T: 'static + Hash
[src]

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

impl<T> PartialEqBytes for T where
    T: 'static + PartialEq<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.