Frame

Struct Frame 

Source
pub struct Frame { /* private fields */ }
Expand description

The base message type is frame

Implementations§

Source§

impl Frame

Source

pub fn new_data(flags: Flags, stream_id: u32, body: BytesMut) -> Frame

Create a data frame

Source

pub fn new_window_update(flags: Flags, stream_id: u32, delta: u32) -> Frame

Create a window update frame

Source

pub fn new_ping(flags: Flags, ping_id: u32) -> Frame

Create a ping frame

Source

pub fn new_go_away(reason: GoAwayCode) -> Frame

Create a go away frame

Source

pub fn ty(&self) -> Type

The type of current frame

Source

pub fn stream_id(&self) -> u32

The stream id of current frame

Source

pub fn flags(&self) -> Flags

The flags of current frame

Source

pub fn length(&self) -> u32

The length field of current body or some other things such as ping_id/go away code/delta

Source

pub fn into_parts(self) -> (Header, Option<BytesMut>)

Consume current frame split into header and body

Source

pub fn size(&self) -> usize

The length field of current frame

Trait Implementations§

Source§

impl Debug for Frame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Encoder<Frame> for FrameCodec

Source§

type Error = Error

The type of encoding errors. Read more
Source§

fn encode(&mut self, item: Frame, dst: &mut BytesMut) -> Result<(), Self::Error>

Encodes a frame into the buffer provided. Read more
Source§

impl PartialEq for Frame

Source§

fn eq(&self, other: &Frame) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Frame

Source§

impl StructuralPartialEq for Frame

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnwindSafe for Frame

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.