pub trait StacksMessageCodec {
// Required methods
fn consensus_serialize<W: Write>(&self, fd: &mut W) -> Result<(), Error>
where Self: Sized;
fn consensus_deserialize<R: Read>(fd: &mut R) -> Result<Self, Error>
where Self: Sized;
// Provided method
fn serialize_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized { ... }
}
Expand description
Helper trait for various primitive types that make up Stacks messages
Required Methods§
Sourcefn consensus_serialize<W: Write>(&self, fd: &mut W) -> Result<(), Error>where
Self: Sized,
fn consensus_serialize<W: Write>(&self, fd: &mut W) -> Result<(), Error>where
Self: Sized,
serialize implementors should never error unless there is an underlying
failure in writing to the fd