pub trait EpeeValue: Sized + Sealed {
const MARKER: Marker;
// Required methods
fn read<R: Read>(r: &mut R, marker: &Marker) -> Result<Self>;
fn write<W: Write>(&self, w: &mut W) -> Result<()>;
// Provided methods
fn should_write(&self) -> bool { ... }
fn epee_default_value() -> Option<Self> { ... }
}
Expand description
A trait for epee values, this trait is sealed as all possible epee values are
defined in the lib, to make an EpeeValue
outside the lib you will need to
use the trait EpeeObject
.
Required Associated Constants§
Required Methods§
fn read<R: Read>(r: &mut R, marker: &Marker) -> Result<Self>
fn write<W: Write>(&self, w: &mut W) -> 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.