pub(super) struct Counts {
peer: Dyn,
max_send_streams: usize,
num_send_streams: usize,
max_recv_streams: usize,
num_recv_streams: usize,
max_local_reset_streams: usize,
num_local_reset_streams: usize,
max_remote_reset_streams: usize,
num_remote_reset_streams: usize,
max_local_error_reset_streams: Option<usize>,
num_local_error_reset_streams: usize,
}
Fields§
§peer: Dyn
Acting as a client or server. This allows us to track which values to inc / dec.
max_send_streams: usize
Maximum number of locally initiated streams
num_send_streams: usize
Current number of remote initiated streams
max_recv_streams: usize
Maximum number of remote initiated streams
num_recv_streams: usize
Current number of locally initiated streams
max_local_reset_streams: usize
Maximum number of pending locally reset streams
num_local_reset_streams: usize
Current number of pending locally reset streams
max_remote_reset_streams: usize
Max number of “pending accept” streams that were remotely reset
num_remote_reset_streams: usize
Current number of “pending accept” streams that were remotely reset
max_local_error_reset_streams: Option<usize>
Maximum number of locally reset streams due to protocol error across the lifetime of the connection.
When this gets exceeded, we issue GOAWAYs.
num_local_error_reset_streams: usize
Total number of locally reset streams due to protocol error across the lifetime of the connection.
Implementations§
source§impl Counts
impl Counts
sourcepub fn new(peer: Dyn, config: &Config) -> Self
pub fn new(peer: Dyn, config: &Config) -> Self
Create a new Counts
using the provided configuration values.
sourcepub fn next_send_stream_will_reach_capacity(&self) -> bool
pub fn next_send_stream_will_reach_capacity(&self) -> bool
Returns true when the next opened stream will reach capacity of outbound streams
The number of client send streams is incremented in prioritize; send_request has to guess if it should wait before allowing another request to be sent.
pub fn has_streams(&self) -> bool
sourcepub fn can_inc_num_local_error_resets(&self) -> bool
pub fn can_inc_num_local_error_resets(&self) -> bool
Returns true if we can issue another local reset due to protocol error.
pub fn inc_num_local_error_resets(&mut self)
pub(crate) fn max_local_error_resets(&self) -> Option<usize>
sourcepub fn can_inc_num_recv_streams(&self) -> bool
pub fn can_inc_num_recv_streams(&self) -> bool
Returns true if the receive stream concurrency can be incremented
sourcepub fn inc_num_recv_streams(&mut self, stream: &mut Ptr<'_>)
pub fn inc_num_recv_streams(&mut self, stream: &mut Ptr<'_>)
Increments the number of concurrent receive streams.
§Panics
Panics on failure as this should have been validated before hand.
sourcepub fn can_inc_num_send_streams(&self) -> bool
pub fn can_inc_num_send_streams(&self) -> bool
Returns true if the send stream concurrency can be incremented
sourcepub fn inc_num_send_streams(&mut self, stream: &mut Ptr<'_>)
pub fn inc_num_send_streams(&mut self, stream: &mut Ptr<'_>)
Increments the number of concurrent send streams.
§Panics
Panics on failure as this should have been validated before hand.
sourcepub fn can_inc_num_reset_streams(&self) -> bool
pub fn can_inc_num_reset_streams(&self) -> bool
Returns true if the number of pending reset streams can be incremented.
sourcepub fn inc_num_reset_streams(&mut self)
pub fn inc_num_reset_streams(&mut self)
Increments the number of pending reset streams.
§Panics
Panics on failure as this should have been validated before hand.
pub(crate) fn max_remote_reset_streams(&self) -> usize
sourcepub(crate) fn can_inc_num_remote_reset_streams(&self) -> bool
pub(crate) fn can_inc_num_remote_reset_streams(&self) -> bool
Returns true if the number of pending REMOTE reset streams can be incremented.
sourcepub(crate) fn inc_num_remote_reset_streams(&mut self)
pub(crate) fn inc_num_remote_reset_streams(&mut self)
Increments the number of pending REMOTE reset streams.
§Panics
Panics on failure as this should have been validated before hand.
pub(crate) fn dec_num_remote_reset_streams(&mut self)
pub fn apply_remote_settings(&mut self, settings: &Settings)
sourcepub fn transition<F, U>(&mut self, stream: Ptr<'_>, f: F) -> U
pub fn transition<F, U>(&mut self, stream: Ptr<'_>, f: F) -> U
Run a block of code that could potentially transition a stream’s state.
If the stream state transitions to closed, this function will perform all necessary cleanup.
TODO: Is this function still needed?
pub fn transition_after(&mut self, stream: Ptr<'_>, is_reset_counted: bool)
sourcepub(crate) fn max_send_streams(&self) -> usize
pub(crate) fn max_send_streams(&self) -> usize
Returns the maximum number of streams that can be initiated by this peer.
sourcepub(crate) fn max_recv_streams(&self) -> usize
pub(crate) fn max_recv_streams(&self) -> usize
Returns the maximum number of streams that can be initiated by the remote peer.