Trait packet::FromRaw

source ·
pub trait FromRaw<R, A>: Sized {
    type Error;

    // Required method
    fn try_from_raw_with(raw: R, args: A) -> Result<Self, Self::Error>;

    // Provided method
    fn try_from_raw(raw: R) -> Result<Self, <Self as FromRaw<R, A>>::Error>
       where Self: FromRaw<R, (), Error = <Self as FromRaw<R, A>>::Error> { ... }
}
Expand description

A packet that can be created from a raw form.

FromRaw provides a common interface for packets that can be created from an “unchecked” form - that is, that are parsed raw without any higher-order validation.

The type parameter R is the raw type that the FromRaw type can be converted from, given some arguments of type A.

Required Associated Types§

source

type Error

The type of error that may happen during validation.

Required Methods§

source

fn try_from_raw_with(raw: R, args: A) -> Result<Self, Self::Error>

Attempts to create Self from the raw form in raw with args.

Provided Methods§

source

fn try_from_raw(raw: R) -> Result<Self, <Self as FromRaw<R, A>>::Error>
where Self: FromRaw<R, (), Error = <Self as FromRaw<R, A>>::Error>,

Attempts to create Self from the raw form in raw.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<B, R> FromRaw<RecordsRaw<B, R>, ()> for Records<B, R>
where for<'a> R: RecordsImpl<'a>, B: ByteSlice,