[−][src]Enum canonical::Repr
The Repr
type can be thought of as a host-allocating version of Box
Variants
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]
S: Store,
T: Canon<S>,
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]
T: Canon<S>,
S: Store,
fn write(&self, sink: &mut impl Sink<S>) -> Result<(), S::Error>
[src]
fn read(source: &mut impl Source<S>) -> Result<Self, S::Error>
[src]
fn encoded_len(&self) -> usize
[src]
impl<T: Clone, S: Clone + Store> Clone for Repr<T, S> where
S::Ident: Clone,
S::Ident: Clone,
[src]
S::Ident: Clone,
S::Ident: Clone,
fn clone(&self) -> Repr<T, S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug, S: Debug + Store> Debug for Repr<T, S> where
S::Ident: Debug,
S::Ident: Debug,
[src]
S::Ident: Debug,
S::Ident: Debug,
Auto Trait Implementations
impl<T, S> Send for Repr<T, S> where
T: Send,
<S as Store>::Ident: Send,
T: Send,
<S as Store>::Ident: Send,
impl<T, S> Sync for Repr<T, S> where
T: Sync,
<S as Store>::Ident: Sync,
T: Sync,
<S as Store>::Ident: Sync,
impl<T, S> Unpin for Repr<T, S> where
T: Unpin,
<S as Store>::Ident: Unpin,
T: Unpin,
<S as Store>::Ident: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,