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 FromFrame for i16

source§

impl FromFrame for u64

source§

impl FromFrame for i64

source§

impl FromFrame for u16

source§

impl FromFrame for i8

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<i8, <i8 as FromFrame>::Error>

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<Option<T>, <Option<T> as FromFrame>::Error>

source§

impl FromFrame for String

source§

impl FromFrame for i32

source§

impl FromFrame for bool

source§

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

source§

impl FromFrame for u32

source§

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

§

type Error = Error

source§

fn parse_frame( frame: &mut Bytes ) -> Result<Vec<T, Global>, <Vec<T, Global> as FromFrame>::Error>

source§

impl FromFrame for u8

§

type Error = Error

source§

fn parse_frame(frame: &mut Bytes) -> Result<u8, <u8 as FromFrame>::Error>

Implementors§