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§

source

type Error

The error type returned when parsing a frame.

Required Methods§

source

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

Parse a frame into a Self.

Provided Methods§

source

fn from_frame(frame: Bytes) -> Result<Self, Self::Error>

Convert a frame into a Self.

Implementations on Foreign Types§

source§

impl<T> FromFrame for Option<T>where T: FromFrame, <T as FromFrame>::Error: Into<Error>,

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for u8

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for i16

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for u32

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl<T> FromFrame for Vec<T>where T: FromFrame, <T as FromFrame>::Error: Into<Error>,

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for i8

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl<T> FromFrame for HashSet<T>where T: FromFrame + PartialEq + Eq + Hash, <T as FromFrame>::Error: Into<Error>,

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for bool

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for String

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for u16

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for i64

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for u64

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

source§

impl FromFrame for i32

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<Self, Self::Error>

Implementors§