pub trait FromFrame: Sized {
type Error;
// Required method
fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>;
// Provided method
fn from_frame(frame: Bytes) -> Result<Self, Self::Error> { ... }
}Expand description
Trait for converting a frame into `Self.
Required Associated Types§
Required Methods§
Sourcefn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>
fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>
Parse a frame into a Self.
Provided Methods§
Sourcefn from_frame(frame: Bytes) -> Result<Self, Self::Error>
fn from_frame(frame: Bytes) -> Result<Self, Self::Error>
Convert a frame into a Self.
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.