Trait s2n_quic_transport::stream::StreamTrait

source ·
pub trait StreamTrait: StreamInterestProvider + Provider + Debug {
Show 16 methods // Required methods fn new(config: StreamConfig) -> Self; fn stream_id(&self) -> StreamId; fn on_data( &mut self, frame: &StreamRef<'_>, events: &mut StreamEvents ) -> Result<(), Error>; fn on_stream_data_blocked( &mut self, frame: &StreamDataBlocked, events: &mut StreamEvents ) -> Result<(), Error>; fn on_reset( &mut self, frame: &ResetStream, events: &mut StreamEvents ) -> Result<(), Error>; fn on_max_stream_data( &mut self, frame: &MaxStreamData, events: &mut StreamEvents ) -> Result<(), Error>; fn on_stop_sending( &mut self, frame: &StopSending, events: &mut StreamEvents ) -> Result<(), Error>; fn on_packet_ack<A: Set>(&mut self, ack_set: &A, events: &mut StreamEvents); fn on_packet_loss<A: Set>(&mut self, ack_set: &A, events: &mut StreamEvents); fn update_blocked_sync_period(&mut self, blocked_sync_period: Duration); fn on_timeout(&mut self, now: Timestamp); fn on_internal_reset( &mut self, error: StreamError, events: &mut StreamEvents ); fn on_flush(&mut self, error: StreamError, events: &mut StreamEvents); fn on_transmit<W: WriteContext>( &mut self, context: &mut W ) -> Result<(), OnTransmitError>; fn on_connection_window_available(&mut self); fn poll_request( &mut self, request: &mut Request<'_>, context: Option<&Context<'_>> ) -> Result<Response, StreamError>;
}
Expand description

A trait which represents an internally used Stream

Required Methods§

source

fn new(config: StreamConfig) -> Self

Creates a new Stream instance with the given configuration

source

fn stream_id(&self) -> StreamId

Returns the Streams ID

source

fn on_data( &mut self, frame: &StreamRef<'_>, events: &mut StreamEvents ) -> Result<(), Error>

This is called when a STREAM_DATA frame had been received for this stream

source

fn on_stream_data_blocked( &mut self, frame: &StreamDataBlocked, events: &mut StreamEvents ) -> Result<(), Error>

This is called when a STREAM_DATA_BLOCKED frame had been received for this stream

source

fn on_reset( &mut self, frame: &ResetStream, events: &mut StreamEvents ) -> Result<(), Error>

This is called when a RESET_STREAM frame had been received for this stream

source

fn on_max_stream_data( &mut self, frame: &MaxStreamData, events: &mut StreamEvents ) -> Result<(), Error>

This is called when a MAX_STREAM_DATA frame had been received for this stream

source

fn on_stop_sending( &mut self, frame: &StopSending, events: &mut StreamEvents ) -> Result<(), Error>

This is called when a STOP_SENDING frame had been received for this stream

source

fn on_packet_ack<A: Set>(&mut self, ack_set: &A, events: &mut StreamEvents)

This method gets called when a packet delivery got acknowledged

source

fn on_packet_loss<A: Set>(&mut self, ack_set: &A, events: &mut StreamEvents)

This method gets called when a packet loss is reported

source

fn update_blocked_sync_period(&mut self, blocked_sync_period: Duration)

Updates the period at which STREAM_DATA_BLOCKED frames are sent to the peer if the application is blocked by peer limits.

source

fn on_timeout(&mut self, now: Timestamp)

Called when the connection timer expires

source

fn on_internal_reset(&mut self, error: StreamError, events: &mut StreamEvents)

This method gets called when a stream gets reset due to a reason that is not related to a frame. E.g. due to a connection failure.

source

fn on_flush(&mut self, error: StreamError, events: &mut StreamEvents)

This method is called when the application drops the connection

The stream should finish any pending operations and close

source

fn on_transmit<W: WriteContext>( &mut self, context: &mut W ) -> Result<(), OnTransmitError>

Queries the component for any outgoing frames that need to get sent

source

fn on_connection_window_available(&mut self)

This method is called when a connection window is available

source

fn poll_request( &mut self, request: &mut Request<'_>, context: Option<&Context<'_>> ) -> Result<Response, StreamError>

Object Safety§

This trait is not object safe.

Implementors§