pub struct Response<'buf, 'ids, 'headers> {
    pub from: &'buf [u8],
    pub ids: &'ids [Id<'buf>],
    pub multi: bool,
    pub ptype: ResponsePacket<'buf, 'headers>,
    pub ptype_str: &'buf str,
}

Fields§

§from: &'buf [u8]§ids: &'ids [Id<'buf>]§multi: bool§ptype: ResponsePacket<'buf, 'headers>§ptype_str: &'buf str

Implementations§

source§

impl<'buf, 'ids, 'headers> Response<'buf, 'ids, 'headers>

source

pub fn new_data( from: &'buf [u8], ids: &'ids [Id<'buf>], data: ResponseData<'buf, 'headers> ) -> Self

source

pub fn new_error( from: &'buf [u8], ids: &'ids [Id<'buf>], edata: ResponseErrorData<'buf, 'headers> ) -> Self

source

pub fn new_credit(from: &'buf [u8], ids: &'ids [Id<'buf>], credits: u32) -> Self

source

pub fn new_keep_alive(from: &'buf [u8], ids: &'ids [Id<'buf>]) -> Self

source

pub fn new_cancel(from: &'buf [u8], ids: &'ids [Id<'buf>]) -> Self

source

pub fn new_handoff_proceed(from: &'buf [u8], ids: &'ids [Id<'buf>]) -> Self

source

pub fn new_close( from: &'buf [u8], ids: &'ids [Id<'buf>], status: Option<(u16, &'buf str)> ) -> Self

source

pub fn new_ping( from: &'buf [u8], ids: &'ids [Id<'buf>], body: &'buf [u8] ) -> Self

source

pub fn new_pong( from: &'buf [u8], ids: &'ids [Id<'buf>], body: &'buf [u8] ) -> Self

source

pub fn serialize(&self, dest: &mut [u8]) -> Result<usize, Error>

Trait Implementations§

source§

impl<'buf: 'scratch, 'scratch> PacketParse<'buf, 'scratch> for Response<'buf, 'scratch, 'scratch>

§

type Parsed = Response<'buf, 'scratch, 'scratch>

source§

fn parse( src: &'buf [u8], scratch: &'scratch mut ParseScratch<'buf> ) -> Result<Self::Parsed, ParseError>

Auto Trait Implementations§

§

impl<'buf, 'ids, 'headers> RefUnwindSafe for Response<'buf, 'ids, 'headers>

§

impl<'buf, 'ids, 'headers> Send for Response<'buf, 'ids, 'headers>

§

impl<'buf, 'ids, 'headers> Sync for Response<'buf, 'ids, 'headers>

§

impl<'buf, 'ids, 'headers> Unpin for Response<'buf, 'ids, 'headers>

§

impl<'buf, 'ids, 'headers> UnwindSafe for Response<'buf, 'ids, 'headers>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.