[][src]Struct dync::Value

pub struct Value<B, V: ?Sized> where
    B: GetBytesMut,
    V: HasDrop
{ /* fields omitted */ }

Implementations

impl<V: HasDrop> Value<MaybeUninit<usize>, V>[src]

pub fn try_new<T: Any + DropBytes>(
    value: T
) -> Option<Value<MaybeUninit<usize>, V>> where
    V: VTable<T>, 
[src]

pub fn new<T: Any + DropBytes>(value: T) -> Value<MaybeUninit<usize>, V> where
    V: VTable<T>, 
[src]

This function will panic if the given type does not fit into a usize.

impl<V: ?Sized + HasDrop> Value<MaybeUninit<usize>, V>[src]

pub fn upcast<U: HasDrop + From<V>>(self) -> SmallValue<U> where
    V: Clone
[src]

pub fn into_raw_parts(self) -> (MaybeUninit<usize>, TypeId, Ptr<V>)[src]

Convert this value into its destructured parts.

The caller must insure that the memory allocated by the returned bytes is freed.

impl<V: HasDrop> Value<Box<[MaybeUninit<u8>]>, V>[src]

pub fn new<T: Any + DropBytes>(value: T) -> Value<Box<[MaybeUninit<u8>]>, V> where
    V: VTable<T>, 
[src]

impl<V: ?Sized + HasDrop> Value<Box<[MaybeUninit<u8>]>, V>[src]

pub fn upcast<U: HasDrop + From<V>>(self) -> BoxValue<U> where
    V: Clone
[src]

pub fn into_raw_parts(self) -> (Box<[MaybeUninit<u8>]>, TypeId, Ptr<V>)[src]

Convert this value into its destructured parts.

The caller must insure that the memory allocated by the returned bytes is freed.

impl<B: GetBytesMut, V: ?Sized + HasDrop> Value<B, V>[src]

pub fn as_ref(&self) -> ValueRef<V>[src]

pub fn as_mut(&mut self) -> ValueMut<V>[src]

impl<B: GetBytesMut, V: ?Sized + HasDrop> Value<B, 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.

impl<V: ?Sized + HasDrop> Value<Box<[MaybeUninit<u8>]>, V>[src]

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

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

impl<V: ?Sized + HasDrop> Value<MaybeUninit<usize>, V>[src]

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

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

Trait Implementations

impl<V: ?Sized + Clone + HasClone + HasDrop> Clone for Value<MaybeUninit<usize>, V>[src]

impl<V: ?Sized + Clone + HasClone + HasDrop> Clone for Value<Box<[MaybeUninit<u8>]>, V>[src]

impl<B: GetBytesMut, V: ?Sized + HasDebug + HasDrop> Debug for Value<B, V>[src]

impl<B: GetBytesMut, V: ?Sized + HasDrop> Drop for Value<B, V>[src]

impl<B: GetBytesMut, V: ?Sized + HasDrop + HasPartialEq> Eq for Value<B, V>[src]

impl<'a, B: GetBytesMut, V: Clone + HasDrop> From<&'a Value<B, V>> for Meta<Ptr<V>>[src]

impl<'a, B: GetBytesMut, V: ?Sized> From<&'a Value<B, V>> for ValueRef<'a, V> where
    B: GetBytesRef,
    V: Clone + HasDrop
[src]

impl<B: GetBytesMut, V: ?Sized + HasDrop + HasHash> Hash for Value<B, V>[src]

impl<B: GetBytesMut, V: ?Sized + HasDrop + HasPartialEq> PartialEq<Value<B, V>> for Value<B, V>[src]

fn eq(&self, other: &Self) -> bool[src]

Panics

This function panics if the types of the two operands don't match.

impl<B: GetBytesMut, V: ?Sized + HasDrop + HasSend> Send for Value<B, V>[src]

impl<B: GetBytesMut, V: ?Sized + HasDrop + HasSync> Sync for Value<B, V>[src]

Auto Trait Implementations

impl<B, V: ?Sized> RefUnwindSafe for Value<B, V> where
    B: RefUnwindSafe,
    V: RefUnwindSafe

impl<B, V: ?Sized> Unpin for Value<B, V> where
    B: Unpin

impl<B, V: ?Sized> UnwindSafe for Value<B, V> where
    B: UnwindSafe,
    V: 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.