#[non_exhaustive]pub enum Event {
HandshakeFailed {
reason: AssociationError,
},
Connected,
Restarted,
AssociationLost {
reason: AssociationError,
id: StreamId,
},
AssociationClosed {
reason: AssociationError,
},
PathInactive,
PathActive,
CommunicationError {
causes: Vec<(ErrorCauseCode, Bytes)>,
},
SendFailure {
unsent: usize,
unacknowledged: usize,
},
Stream(StreamEvent),
DatagramReceived,
Reconfig(ReconfigEvent),
}Expand description
Events of interest to the application
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HandshakeFailed
Handshake was failed
Fields
reason: AssociationErrorReason that the association was closed
Connected
The association was successfully established
Restarted
The peer restarted the association (RFC 9260 5.2.4 action A): it sent an INIT and
then a COOKIE ECHO with the Tie-Tags of this association, as an endpoint that lost
its state does. The association is a new one from here on, with new tags and TSNs,
no streams and congestion control from its initial values; what was queued or in
flight on the old one is gone. Reported instead of Event::AssociationLost (5.2.4:
“a RESTART notification”).
AssociationLost
The association was lost
Emitted if the peer closes the association or an error is encountered.
Fields
reason: AssociationErrorReason that the association was closed
AssociationClosed
The association closed, after an AssociationLost for each of its streams. Emitted
whether or not it had streams, so an application that keeps state beside the
association (a pre-negotiated data channel that never carried data) learns of it.
Fields
reason: AssociationErrorReason that the association was closed
PathInactive
The path to the peer is inactive: Path.Max.Retrans consecutive retransmissions or
HEARTBEATs went unanswered (RFC 9260 sections 8.2, 8.3). The association goes on
trying, up to TimerConfig::max_t3_rtx_retrans.
PathActive
The path to the peer answers again after Event::PathInactive.
CommunicationError
The peer sent an ERROR chunk (RFC 9260 11.2.5 COMMUNICATION ERROR): each cause’s code and its cause-specific information as received (RFC 9260 3.3.10).
Fields
causes: Vec<(ErrorCauseCode, Bytes)>The causes, in the order the chunk carried them.
SendFailure
The association ended with user messages it did not deliver (RFC 9260 11.2.2 SEND
FAILURE, 8.1): read them with
Association::take_undelivered_messages. Reported before
Event::AssociationClosed. A message of a partially reliable stream given up while
the association ran is reported with
StreamEvent::MessageAbandoned instead.
Fields
Stream(StreamEvent)
Stream events
DatagramReceived
One or more application datagrams have been received
Reconfig(ReconfigEvent)
The outcome of a stream re-configuration (RFC 6525): a request of this side’s own was answered, or the peer changed the association.