Struct h2::proto::streams::store::Ptr

source ·
pub(super) struct Ptr<'a> {
    key: Key,
    store: &'a mut Store,
}
Expand description

“Pointer” to an entry in the store

Fields§

§key: Key§store: &'a mut Store

Implementations§

source§

impl<'a> Ptr<'a>

source

pub fn key(&self) -> Key

Returns the Key associated with the stream

source

pub fn store_mut(&mut self) -> &mut Store

source

pub fn remove(self) -> StreamId

Remove the stream from the store

Remove the StreamId -> stream state association.

This will effectively remove the stream as far as the H2 protocol is concerned.

Methods from Deref<Target = Stream>§

source

pub fn ref_inc(&mut self)

Increment the stream’s ref count

source

pub fn ref_dec(&mut self)

Decrements the stream’s ref count

source

pub fn is_pending_reset_expiration(&self) -> bool

Returns true if stream is currently being held for some time because of a local reset.

source

pub fn is_send_ready(&self) -> bool

Returns true if frames for this stream are ready to be sent over the wire

source

pub fn is_closed(&self) -> bool

Returns true if the stream is closed

source

pub fn is_released(&self) -> bool

Returns true if the stream is no longer in use

source

pub fn is_canceled_interest(&self) -> bool

Returns true when the consumer of the stream has dropped all handles (indicating no further interest in the stream) and the stream state is not actually closed.

In this case, a reset should be sent.

source

pub fn capacity(&self, max_buffer_size: usize) -> u32

Current available stream send capacity

source

pub fn assign_capacity(&mut self, capacity: u32, max_buffer_size: usize)

source

pub fn send_data(&mut self, len: u32, max_buffer_size: usize)

source

pub fn notify_capacity(&mut self)

If the capacity was limited because of the max_send_buffer_size, then consider waking the send task again…

source

pub fn dec_content_length(&mut self, len: usize) -> Result<(), ()>

Returns Err when the decrement cannot be completed due to overflow.

source

pub fn ensure_content_length_zero(&self) -> Result<(), ()>

source

pub fn notify_send(&mut self)

source

pub fn wait_send(&mut self, cx: &Context<'_>)

source

pub fn notify_recv(&mut self)

Trait Implementations§

source§

impl<'a> Debug for Ptr<'a>

source§

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

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

impl<'a> Deref for Ptr<'a>

source§

type Target = Stream

The resulting type after dereferencing.
source§

fn deref(&self) -> &Stream

Dereferences the value.
source§

impl<'a> DerefMut for Ptr<'a>

source§

fn deref_mut(&mut self) -> &mut Stream

Mutably dereferences the value.
source§

impl<'a> Resolve for Ptr<'a>

source§

fn resolve(&mut self, key: Key) -> Ptr<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for Ptr<'a>

§

impl<'a> RefUnwindSafe for Ptr<'a>

§

impl<'a> Send for Ptr<'a>

§

impl<'a> Sync for Ptr<'a>

§

impl<'a> Unpin for Ptr<'a>

§

impl<'a> !UnwindSafe for Ptr<'a>

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