[][src]Enum canonical::Repr

pub enum Repr<T, S: Store> {
    Inline {
        bytes: S::Ident,
        len: u8,
        _marker: PhantomData<T>,
    },
    Ident(S::Ident),
}

The Repr type can be thought of as a host-allocating version of Box

Variants

Inline

Value is stored inline in the bytes of an identifier

Fields of Inline

bytes: S::Ident

Thy bytes of the ident is used for the encoded value

len: u8

The length of the encoded value

_marker: PhantomData<T>

The represented type

Ident(S::Ident)

Value is stored host-side referenced by an identifier

Implementations

impl<T, S> Repr<T, S> where
    S: Store,
    T: Canon<S>, 
[src]

pub fn new(t: T) -> Self[src]

Construct a new Repr from value t

pub fn restore(&self) -> Result<T, S::Error>[src]

Restore the value from the repr

Trait Implementations

impl<T, S> Canon<S> for Repr<T, S> where
    T: Canon<S>,
    S: Store
[src]

impl<T: Clone, S: Clone + Store> Clone for Repr<T, S> where
    S::Ident: Clone,
    S::Ident: Clone
[src]

impl<T: Debug, S: Debug + Store> Debug for Repr<T, S> where
    S::Ident: Debug,
    S::Ident: Debug
[src]

Auto Trait Implementations

impl<T, S> Send for Repr<T, S> where
    T: Send,
    <S as Store>::Ident: Send

impl<T, S> Sync for Repr<T, S> where
    T: Sync,
    <S as Store>::Ident: Sync

impl<T, S> Unpin for Repr<T, S> where
    T: Unpin,
    <S as Store>::Ident: Unpin

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, 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.