pub trait FromProtocolValue {
// Required methods
fn from_text(raw: &[u8]) -> Result<Self, ProtocolError>
where Self: Sized;
fn from_binary(raw: &[u8]) -> Result<Self, ProtocolError>
where Self: Sized;
// Provided method
fn from_protocol(raw: &[u8], format: Format) -> Result<Self, ProtocolError>
where Self: Sized { ... }
}Expand description
This trait explains how to decode values from the protocol It’s used in the Bind message
Required Methods§
Sourcefn from_text(raw: &[u8]) -> Result<Self, ProtocolError>where
Self: Sized,
fn from_text(raw: &[u8]) -> Result<Self, ProtocolError>where
Self: Sized,
Decodes raw value to native type in text format
Sourcefn from_binary(raw: &[u8]) -> Result<Self, ProtocolError>where
Self: Sized,
fn from_binary(raw: &[u8]) -> Result<Self, ProtocolError>where
Self: Sized,
Decodes raw value to native type in binary format
Provided Methods§
fn from_protocol(raw: &[u8], format: Format) -> Result<Self, ProtocolError>where
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".