#[non_exhaustive]pub enum StreamEvent {
Opened {
id: StreamId,
},
Readable {
id: StreamId,
},
Writable {
id: StreamId,
},
Finished {
id: StreamId,
},
ResetComplete {
id: StreamId,
},
ResetFailed {
id: StreamId,
reason: StreamResetError,
},
Stopped {
id: StreamId,
error_code: ErrorCauseCode,
},
Available,
BufferedAmountLow {
id: StreamId,
},
BufferedAmountHigh {
id: StreamId,
},
}Expand description
Application events about streams
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Opened
One or more new streams has been opened
Readable
A currently open stream has data or errors waiting to be read
Writable
A formerly write-blocked stream might be ready for a write or have been stopped
Only generated for streams that are currently open.
Finished
The stream was torn down by a reset, an inbound reset request from the peer naming the id was processed or its reciprocal to a locally-initiated one.
No more data can be read from or written to it.
Once this fires, either StreamEvent::ResetComplete or
StreamEvent::ResetFailed for the same id is guaranteed to eventually
follow, unless the association closes first.
ResetComplete
A reset handshake involving this stream id completed successfully.
The id can be reused unless a newer reset for the same id has since started or failed.
ResetFailed
A reset handshake involving this stream id did not complete.
The id remains unavailable for reuse until a later reset succeeds or the association closes.
Fields
reason: StreamResetErrorWhy the reset did not complete.
Stopped
The peer asked us to stop sending on an outgoing stream
Fields
error_code: ErrorCauseCodeError code supplied by the peer
Available
At least one new stream of a certain directionality may be opened
BufferedAmountLow
The number of bytes of outgoing data buffered is lower than the threshold.
BufferedAmountHigh
The number of bytes of outgoing data buffered is higher than the threshold.