#[non_exhaustive]pub enum StreamEvent {
Opened {
id: StreamId,
},
Readable {
id: StreamId,
},
Writable {
id: StreamId,
},
Finished {
id: StreamId,
},
Stopped {
id: StreamId,
error_code: ErrorCauseCode,
},
Available,
BufferedAmountLow {
id: StreamId,
},
BufferedAmountHigh {
id: StreamId,
},
BufferedAmountReleased {
id: StreamId,
n_bytes: usize,
},
}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
A finished stream has been fully acknowledged or stopped
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.
BufferedAmountReleased
Outgoing buffered data was released (acknowledged OR abandoned), carrying
the exact number of user payload bytes freed for this stream. Unlike the
edge-triggered StreamEvent::BufferedAmountLow, this fires on every
release with the byte delta, so upper layers can keep their own
send-buffer accounting (e.g. a synchronous back-pressure counter) exact.