[][src]Struct dync::ValueRef

pub struct ValueRef<'a, V> { /* fields omitted */ }

A generic value reference into a buffer.

Methods

impl<'a, V> ValueRef<'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 is<T: 'static>(&self) -> bool[src]

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

pub fn new<T: Any + DropBytes>(typed: &'a T) -> ValueRef<'a, V> where
    V: VTable<T>, 
[src]

Create a new ValueRef from a typed reference.

pub fn clone_value(&self) -> Value<Box<[u8]>, V> where
    V: HasClone + Clone
[src]

Clone the referenced value.

Unlike the Clone trait, this function will produce an owned clone of the value pointed to by this value reference.

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

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

Trait Implementations

impl<'a, V: Clone> Clone for ValueRef<'a, V>[src]

impl<'a, V: HasDebug> Debug for ValueRef<'a, V>[src]

impl<'a, V: HasEq> Eq for ValueRef<'a, V>[src]

impl<'a, V> From<ValueMut<'a, V>> for ValueRef<'a, V>[src]

impl<'a, V: HasHash> Hash for ValueRef<'a, V>[src]

impl<'a, V: HasPartialEq> PartialEq<ValueRef<'a, V>> for ValueRef<'a, V>[src]

Auto Trait Implementations

impl<'a, V> RefUnwindSafe for ValueRef<'a, V> where
    V: RefUnwindSafe

impl<'a, V> Send for ValueRef<'a, V> where
    V: Send + Sync

impl<'a, V> Sync for ValueRef<'a, V> where
    V: Sync

impl<'a, V> Unpin for ValueRef<'a, V>

impl<'a, V> UnwindSafe for ValueRef<'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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<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.