pub(super) struct Counts {Show 13 fields
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,
data_frame_budget: Budget,
num_recv_empty_data_frames: usize,
}Fields§
§peer: DynActing as a client or server. This allows us to track which values to inc / dec.
max_send_streams: usizeMaximum number of locally initiated streams
num_send_streams: usizeCurrent number of remote initiated streams
max_recv_streams: usizeMaximum number of remote initiated streams
num_recv_streams: usizeCurrent number of locally initiated streams
max_local_reset_streams: usizeMaximum number of pending locally reset streams
num_local_reset_streams: usizeCurrent number of pending locally reset streams
max_remote_reset_streams: usizeMax number of “pending accept” streams that were remotely reset
num_remote_reset_streams: usizeCurrent 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: usizeTotal number of locally reset streams due to protocol error across the lifetime of the connection.
data_frame_budget: Budgetconnection-level budget for DATA framing overhead.
num_recv_empty_data_frames: usizeNumber of empty, non-final DATA frames received over 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 record_data_frame(
&mut self,
payload_len: usize,
) -> Result<(), BudgetExhausted>
pub fn record_data_frame( &mut self, payload_len: usize, ) -> Result<(), BudgetExhausted>
Records the framing overhead of a DATA frame.
Sourcepub fn release_data_frame(&mut self, payload_len: usize)
pub fn release_data_frame(&mut self, payload_len: usize)
Releases the framing overhead of a DATA frame that is no longer buffered internally.
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, is_initial: bool)
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.