Struct s2n_quic_transport::stream::AbstractStreamManager
source · [−]pub struct AbstractStreamManager<S> { /* private fields */ }
Expand description
Manages all active Stream
s inside a connection.
AbstractStreamManager
is paramterized over the Stream
type.
Implementations
sourceimpl<S: StreamTrait> AbstractStreamManager<S>
impl<S: StreamTrait> AbstractStreamManager<S>
sourcepub fn new(
connection_limits: &Limits,
local_endpoint_type: Type,
initial_local_limits: InitialFlowControlLimits,
initial_peer_limits: InitialFlowControlLimits
) -> Self
pub fn new(
connection_limits: &Limits,
local_endpoint_type: Type,
initial_local_limits: InitialFlowControlLimits,
initial_peer_limits: InitialFlowControlLimits
) -> Self
Creates a new StreamManager
using the provided configuration parameters
sourcepub fn incoming_bytes_progressed(&self) -> VarInt
pub fn incoming_bytes_progressed(&self) -> VarInt
The number of bytes of forward progress the peer has made on incoming streams
sourcepub fn outgoing_bytes_progressed(&self) -> VarInt
pub fn outgoing_bytes_progressed(&self) -> VarInt
The number of bytes of forward progress the local endpoint has made on outgoing streams
sourcepub fn poll_accept(
&mut self,
stream_type: Option<StreamType>,
context: &Context<'_>
) -> Poll<Result<Option<StreamId>, Error>>
pub fn poll_accept(
&mut self,
stream_type: Option<StreamType>,
context: &Context<'_>
) -> Poll<Result<Option<StreamId>, Error>>
Accepts the next incoming stream of a given type
sourcepub fn poll_open(
&mut self,
stream_type: StreamType,
open_token: &mut OpenToken,
context: &Context<'_>
) -> Poll<Result<StreamId, Error>>
pub fn poll_open(
&mut self,
stream_type: StreamType,
open_token: &mut OpenToken,
context: &Context<'_>
) -> Poll<Result<StreamId, Error>>
Opens the next outgoing stream of a certain type
sourcepub fn on_packet_ack<A: Set>(&mut self, ack_set: &A)
pub fn on_packet_ack<A: Set>(&mut self, ack_set: &A)
This method gets called when a packet delivery got acknowledged
sourcepub fn on_packet_loss<A: Set>(&mut self, ack_set: &A)
pub fn on_packet_loss<A: Set>(&mut self, ack_set: &A)
This method gets called when a packet loss is reported
sourcepub fn on_rtt_update(&mut self, rtt_estimator: &RttEstimator)
pub fn on_rtt_update(&mut self, rtt_estimator: &RttEstimator)
This method gets called when the RTT estimate is updated for the active path
sourcepub fn on_timeout(&mut self, now: Timestamp)
pub fn on_timeout(&mut self, now: Timestamp)
Called when the connection timer expires
sourcepub fn close(&mut self, error: Error)
pub fn close(&mut self, error: Error)
Closes the AbstractStreamManager
and resets all streams with the
given error. The current implementation will still
allow to forward frames to the contained Streams as well as to query them
for data. However new Streams can not be created.
sourcepub fn close_reason(&self) -> Option<Error>
pub fn close_reason(&self) -> Option<Error>
If the StreamManager
is closed, this returns the error which which was
used to close it.
sourcepub fn flush(&mut self, error: Error) -> Poll<()>
pub fn flush(&mut self, error: Error) -> Poll<()>
Closes the AbstractStreamManager
, flushes all send streams and resets all receive streams.
This is used for when the application drops the connection but still has pending data to transmit.
sourcepub fn on_transmit<W: WriteContext>(
&mut self,
context: &mut W
) -> Result<(), OnTransmitError>
pub fn on_transmit<W: WriteContext>(
&mut self,
context: &mut W
) -> Result<(), OnTransmitError>
Queries the component for any outgoing frames that need to get sent
sourcepub fn on_data(&mut self, frame: &StreamRef<'_>) -> Result<(), Error>
pub fn on_data(&mut self, frame: &StreamRef<'_>) -> Result<(), Error>
This is called when a STREAM_DATA
frame had been received for
a stream
sourcepub fn on_data_blocked(&mut self, _frame: DataBlocked) -> Result<(), Error>
pub fn on_data_blocked(&mut self, _frame: DataBlocked) -> Result<(), Error>
This is called when a DATA_BLOCKED
frame had been received
sourcepub fn on_stream_data_blocked(
&mut self,
frame: &StreamDataBlocked
) -> Result<(), Error>
pub fn on_stream_data_blocked(
&mut self,
frame: &StreamDataBlocked
) -> Result<(), Error>
This is called when a STREAM_DATA_BLOCKED
frame had been received for
a stream
sourcepub fn on_reset_stream(&mut self, frame: &ResetStream) -> Result<(), Error>
pub fn on_reset_stream(&mut self, frame: &ResetStream) -> Result<(), Error>
This is called when a RESET_STREAM
frame had been received for
a stream
sourcepub fn on_max_stream_data(&mut self, frame: &MaxStreamData) -> Result<(), Error>
pub fn on_max_stream_data(&mut self, frame: &MaxStreamData) -> Result<(), Error>
This is called when a MAX_STREAM_DATA
frame had been received for
a stream
sourcepub fn on_stop_sending(&mut self, frame: &StopSending) -> Result<(), Error>
pub fn on_stop_sending(&mut self, frame: &StopSending) -> Result<(), Error>
This is called when a STOP_SENDING
frame had been received for
a stream
sourcepub fn on_max_data(&mut self, frame: MaxData) -> Result<(), Error>
pub fn on_max_data(&mut self, frame: MaxData) -> Result<(), Error>
This is called when a MAX_DATA
frame had been received
sourcepub fn on_streams_blocked(
&mut self,
_frame: &StreamsBlocked
) -> Result<(), Error>
pub fn on_streams_blocked(
&mut self,
_frame: &StreamsBlocked
) -> Result<(), Error>
This is called when a STREAMS_BLOCKED
frame had been received
sourcepub fn on_max_streams(&mut self, frame: &MaxStreams) -> Result<(), Error>
pub fn on_max_streams(&mut self, frame: &MaxStreams) -> Result<(), Error>
This is called when a MAX_STREAMS
frame had been received
pub fn poll_request(
&mut self,
stream_id: StreamId,
api_call_context: &mut ConnectionApiCallContext<'_>,
request: &mut Request<'_>,
context: Option<&Context<'_>>
) -> Result<Response, StreamError>
Trait Implementations
sourceimpl<S: Debug> Debug for AbstractStreamManager<S>
impl<S: Debug> Debug for AbstractStreamManager<S>
sourceimpl<S: StreamTrait> Provider for AbstractStreamManager<S>
impl<S: StreamTrait> Provider for AbstractStreamManager<S>
sourcefn timers<Q: Query>(&self, query: &mut Q) -> Result
fn timers<Q: Query>(&self, query: &mut Q) -> Result
Notifies the query of any timers owned by the provider Read more
sourcefn next_expiration(&self) -> Option<Timestamp>
fn next_expiration(&self) -> Option<Timestamp>
Returns the next Timestamp
at which the earliest timer is armed in the provider
sourcefn armed_timer_count(&self) -> usize
fn armed_timer_count(&self) -> usize
Counts the number of armed timers in the provider
sourcefn for_each_timer<F>(&self, f: F) where
F: FnMut(&Timer) -> Result<(), QueryBreak>,
fn for_each_timer<F>(&self, f: F) where
F: FnMut(&Timer) -> Result<(), QueryBreak>,
Iterates over each timer in the provider and calls the provided function
impl<S> Send for AbstractStreamManager<S>
Auto Trait Implementations
impl<S> !RefUnwindSafe for AbstractStreamManager<S>
impl<S> !Sync for AbstractStreamManager<S>
impl<S> Unpin for AbstractStreamManager<S>
impl<S> !UnwindSafe for AbstractStreamManager<S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more