pub struct SerialisableValue<T, S>{
pub v: T,
pub ser: S,
}Expand description
A data type equivalent to a pair of value and a serialiser for it
Fields§
§v: TThe value to be serialised
ser: SThe serialise to use
Implementations§
Source§impl<T, S> SerialisableValue<T, S>
impl<T, S> SerialisableValue<T, S>
Sourcepub fn new(v: T, ser: S) -> SerialisableValue<T, S>
pub fn new(v: T, ser: S) -> SerialisableValue<T, S>
Create a new Serialisable type from a T and a Serialiser for T
Sourcepub fn from_tuple(t: (T, S)) -> SerialisableValue<T, S>
pub fn from_tuple(t: (T, S)) -> SerialisableValue<T, S>
Create a new Serialisable type from a pair of T and a Serialiser for T
Trait Implementations§
Source§impl<T, S> Debug for SerialisableValue<T, S>
impl<T, S> Debug for SerialisableValue<T, S>
Source§impl<T, S> From<(T, S)> for SerialisableValue<T, S>
Turns a pair of a Serialiser and value of it’s type T into a
stack-allocated Serialisable
impl<T, S> From<(T, S)> for SerialisableValue<T, S>
Turns a pair of a Serialiser and value of it’s type T into a
stack-allocated Serialisable
Source§fn from(t: (T, S)) -> SerialisableValue<T, S>
fn from(t: (T, S)) -> SerialisableValue<T, S>
Converts to this type from the input type.
Source§impl<T, S> Serialisable for SerialisableValue<T, S>
impl<T, S> Serialisable for SerialisableValue<T, S>
Source§fn size_hint(&self) -> Option<usize>
fn size_hint(&self) -> Option<usize>
An indicator how many bytes must be reserved in a buffer for a value to be
serialsed into it with this serialiser Read more
Source§fn local(
self: Box<SerialisableValue<T, S>>,
) -> Result<Box<dyn Any + Send>, Box<dyn Serialisable>>
fn local( self: Box<SerialisableValue<T, S>>, ) -> Result<Box<dyn Any + Send>, Box<dyn Serialisable>>
Try move this object onto the heap for reflection, instead of serialising Read more
Source§fn cloned(&self) -> Option<Box<dyn Serialisable>>
fn cloned(&self) -> Option<Box<dyn Serialisable>>
Try to produce a cheap in-memory copy of this Read more
Source§fn serialised(&self) -> Result<Serialised, SerError>
fn serialised(&self) -> Result<Serialised, SerError>
Serialise with a one-off buffer Read more
Auto Trait Implementations§
impl<T, S> Freeze for SerialisableValue<T, S>
impl<T, S> RefUnwindSafe for SerialisableValue<T, S>where
T: RefUnwindSafe,
S: RefUnwindSafe,
impl<T, S> Send for SerialisableValue<T, S>
impl<T, S> Sync for SerialisableValue<T, S>
impl<T, S> Unpin for SerialisableValue<T, S>
impl<T, S> UnsafeUnpin for SerialisableValue<T, S>where
T: UnsafeUnpin,
S: UnsafeUnpin,
impl<T, S> UnwindSafe for SerialisableValue<T, S>where
T: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more