Trait cuprate_epee_encoding::EpeeValue
source · pub trait EpeeValue: Sized {
const MARKER: Marker;
// Required methods
fn read<B: Buf>(r: &mut B, marker: &Marker) -> Result<Self>;
fn write<B: BufMut>(self, w: &mut B) -> Result<()>;
// Provided methods
fn should_write(&self) -> bool { ... }
fn epee_default_value() -> Option<Self> { ... }
}
Expand description
A trait for epee values.
All EpeeObject
objects automatically implement EpeeValue
.
Required Associated Constants§
Required Methods§
fn read<B: Buf>(r: &mut B, marker: &Marker) -> Result<Self>
fn write<B: BufMut>(self, w: &mut B) -> Result<()>
Provided Methods§
fn should_write(&self) -> bool
sourcefn epee_default_value() -> Option<Self>
fn epee_default_value() -> Option<Self>
This is different than default field values and instead is the default value of a whole type.
For example a Vec
has a default value of a zero length vec as when a
sequence has no entries it is not encoded.
Object Safety§
This trait is not object safe.