Skip to main content

Stream

Struct Stream 

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

An HTTP/2 stream.

Implementations§

Source§

impl Stream

Source

pub fn new(id: StreamId, initial_window_size: u32) -> Self

Create a new stream.

Source

pub fn id(&self) -> StreamId

Get the stream ID.

Source

pub fn state(&self) -> StreamState

Get the stream state.

Source

pub fn can_send(&self) -> bool

Check if the stream is open for sending.

Source

pub fn can_recv(&self) -> bool

Check if the stream is open for receiving.

Source

pub fn send_window(&self) -> i32

Get the send window size.

Source

pub fn recv_window(&self) -> i32

Get the receive window size.

Source

pub fn send_data(&mut self, size: u32)

Record that we sent data.

Source

pub fn send_end_stream(&mut self)

Record that we sent END_STREAM.

Source

pub fn recv_data(&mut self, size: u32)

Record that we received data.

Source

pub fn recv_end_stream(&mut self)

Record that we received END_STREAM.

Source

pub fn increase_send_window(&mut self, increment: u32)

Increase the send window (from WINDOW_UPDATE).

Source

pub fn adjust_send_window(&mut self, delta: i32)

Adjust the send window (from SETTINGS change).

Source

pub fn reset(&mut self)

Mark the stream as reset.

Source

pub fn bytes_received(&self) -> u32

Get bytes received since last window update.

Source

pub fn reset_bytes_received(&mut self)

Reset bytes received counter.

Trait Implementations§

Source§

impl Debug for Stream

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.