pub trait ConvertWireFormat: WireFormat {
// Required methods
fn to_bytes(&self) -> Bytes;
fn from_bytes(buf: &Bytes) -> Result<Self, Error>
where Self: Sized;
// Provided method
fn as_bytes(&self) -> Vec<u8> ⓘ { ... }
}
Expand description
A trait for converting types to and from a wire format.
Required Methods§
Provided Methods§
Implementors§
impl<T> ConvertWireFormat for Twhere
T: WireFormat,
Implements the ConvertWireFormat
trait for types that implement jetstream_p9::WireFormat
.
This trait provides methods for converting the type to and from bytes.