Struct h2::proto::streams::streams::Actions

source ·
struct Actions {
    recv: Recv,
    send: Send,
    task: Option<Waker>,
    conn_error: Option<Error>,
}

Fields§

§recv: Recv

Manages state transitions initiated by receiving frames

§send: Send

Manages state transitions initiated by sending frames

§task: Option<Waker>

Task that calls poll_complete.

§conn_error: Option<Error>

If the connection errors, a copy is kept for any StreamRefs.

Implementations§

source§

impl Actions

source

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

source

fn reset_on_recv_stream_err<B>( &mut self, buffer: &mut Buffer<Frame<B>>, stream: &mut Ptr<'_>, counts: &mut Counts, res: Result<(), Error> ) -> Result<(), Error>

source

fn ensure_not_idle(&mut self, peer: Dyn, id: StreamId) -> Result<(), Reason>

source

fn ensure_no_conn_error(&self) -> Result<(), Error>

source

fn may_have_forgotten_stream(&self, peer: Dyn, id: StreamId) -> bool

Check if we possibly could have processed and since forgotten this stream.

If we send a RST_STREAM for a stream, we will eventually “forget” about the stream to free up memory. It’s possible that the remote peer had frames in-flight, and by the time we receive them, our own state is gone. We could tear everything down by sending a GOAWAY, but it is more likely to be latency/memory constraints that caused this, and not a bad actor. So be less catastrophic, the spec allows us to send another RST_STREAM of STREAM_CLOSED.

source

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

Trait Implementations§

source§

impl Debug for Actions

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 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> 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 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, 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.
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