Struct h2::proto::streams::send::Send

source ·
pub(super) struct Send {
    next_stream_id: Result<StreamId, StreamIdOverflow>,
    max_stream_id: StreamId,
    init_window_sz: u32,
    prioritize: Prioritize,
    is_push_enabled: bool,
    is_extended_connect_protocol_enabled: bool,
}
Expand description

Manages state transitions related to outbound frames.

Fields§

§next_stream_id: Result<StreamId, StreamIdOverflow>

Stream identifier to use for next initialized stream.

§max_stream_id: StreamId

Any streams with a higher ID are ignored.

This starts as MAX, but is lowered when a GOAWAY is received.

After sending a GOAWAY frame, the sender can discard frames for streams initiated by the receiver with identifiers higher than the identified last stream.

§init_window_sz: u32

Initial window size of locally initiated streams

§prioritize: Prioritize

Prioritization layer

§is_push_enabled: bool§is_extended_connect_protocol_enabled: bool

If extended connect protocol is enabled.

Implementations§

source§

impl Send

source

pub fn new(config: &Config) -> Self

Create a new Send

source

pub fn init_window_sz(&self) -> u32

Returns the initial send window size

source

pub fn open(&mut self) -> Result<StreamId, UserError>

source

pub fn reserve_local(&mut self) -> Result<StreamId, UserError>

source

fn check_headers(fields: &HeaderMap) -> Result<(), UserError>

source

pub fn send_push_promise<B>( &mut self, frame: PushPromise, buffer: &mut Buffer<Frame<B>>, stream: &mut Ptr<'_>, task: &mut Option<Waker>, ) -> Result<(), UserError>

source

pub fn send_headers<B>( &mut self, frame: Headers, buffer: &mut Buffer<Frame<B>>, stream: &mut Ptr<'_>, counts: &mut Counts, task: &mut Option<Waker>, ) -> Result<(), UserError>

source

pub fn send_reset<B>( &mut self, reason: Reason, initiator: Initiator, buffer: &mut Buffer<Frame<B>>, stream: &mut Ptr<'_>, counts: &mut Counts, task: &mut Option<Waker>, )

Send an explicit RST_STREAM frame

source

pub fn schedule_implicit_reset( &mut self, stream: &mut Ptr<'_>, reason: Reason, counts: &mut Counts, task: &mut Option<Waker>, )

source

pub fn send_data<B>( &mut self, frame: Data<B>, buffer: &mut Buffer<Frame<B>>, stream: &mut Ptr<'_>, counts: &mut Counts, task: &mut Option<Waker>, ) -> Result<(), UserError>
where B: Buf,

source

pub fn send_trailers<B>( &mut self, frame: Headers, buffer: &mut Buffer<Frame<B>>, stream: &mut Ptr<'_>, counts: &mut Counts, task: &mut Option<Waker>, ) -> Result<(), UserError>

source

pub fn poll_complete<T, B>( &mut self, cx: &mut Context<'_>, buffer: &mut Buffer<Frame<B>>, store: &mut Store, counts: &mut Counts, dst: &mut Codec<T, Prioritized<B>>, ) -> Poll<Result<()>>
where T: AsyncWrite + Unpin, B: Buf,

source

pub fn reserve_capacity( &mut self, capacity: u32, stream: &mut Ptr<'_>, counts: &mut Counts, )

Request capacity to send data

source

pub fn poll_capacity( &mut self, cx: &Context<'_>, stream: &mut Ptr<'_>, ) -> Poll<Option<Result<u32, UserError>>>

source

pub fn capacity(&self, stream: &mut Ptr<'_>) -> u32

Current available stream send capacity

source

pub fn poll_reset( &self, cx: &Context<'_>, stream: &mut Stream, mode: PollReset, ) -> Poll<Result<Reason, Error>>

source

pub fn recv_connection_window_update( &mut self, frame: WindowUpdate, store: &mut Store, counts: &mut Counts, ) -> Result<(), Reason>

source

pub fn recv_stream_window_update<B>( &mut self, sz: u32, buffer: &mut Buffer<Frame<B>>, stream: &mut Ptr<'_>, counts: &mut Counts, task: &mut Option<Waker>, ) -> Result<(), Reason>

source

pub(super) fn recv_go_away( &mut self, last_stream_id: StreamId, ) -> Result<(), Error>

source

pub fn handle_error<B>( &mut self, buffer: &mut Buffer<Frame<B>>, stream: &mut Ptr<'_>, counts: &mut Counts, )

source

pub fn apply_remote_settings<B>( &mut self, settings: &Settings, buffer: &mut Buffer<Frame<B>>, store: &mut Store, counts: &mut Counts, task: &mut Option<Waker>, ) -> Result<(), Error>

source

pub fn clear_queues(&mut self, store: &mut Store, counts: &mut Counts)

source

pub fn ensure_not_idle(&self, id: StreamId) -> Result<(), Reason>

source

pub fn ensure_next_stream_id(&self) -> Result<StreamId, UserError>

source

pub fn may_have_created_stream(&self, id: StreamId) -> bool

source

pub(super) fn maybe_reset_next_stream_id(&mut self, id: StreamId)

source

pub(crate) fn is_extended_connect_protocol_enabled(&self) -> bool

Trait Implementations§

source§

impl Debug for Send

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Send

§

impl RefUnwindSafe for Send

§

impl Send for Send

§

impl Sync for Send

§

impl Unpin for Send

§

impl UnwindSafe for Send

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more