pub trait ToProtocolValue: Debug {
// Required methods
fn to_text(&self, buf: &mut BytesMut) -> Result<(), ProtocolError>
where Self: Sized;
fn to_binary(&self, buf: &mut BytesMut) -> Result<(), ProtocolError>
where Self: Sized;
// Provided method
fn to_protocol(
&self,
buf: &mut BytesMut,
format: Format,
) -> Result<(), ProtocolError>
where Self: Sized { ... }
}Expand description
This trait explains how to encode values to the protocol format
Required Methods§
Provided Methods§
fn to_protocol(
&self,
buf: &mut BytesMut,
format: Format,
) -> Result<(), ProtocolError>where
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".