#[non_exhaustive]pub enum Event<'a> {
Panicked {
method: &'a str,
message: &'a str,
},
Invalid {
error: &'a ErrorObject,
answered: bool,
},
UnknownNotification {
method: &'a str,
},
Dropped {
method: &'a str,
},
Unmatched {
id: &'a Id<'a>,
},
PeerError {
error: &'a ErrorObject,
},
Oversized {
error: FrameError,
},
Cancelled {
id: &'a Id<'a>,
},
}std only.Expand description
Something the endpoint handled on its own, reported to
Router::on_event so an application can log it.
§Examples
use rpc_io::Event;
fn describe(event: &Event<'_>) -> String {
match event {
Event::Panicked { method, message } => format!("`{method}` panicked: {message}"),
other => format!("{other:?}"),
}
}
assert_eq!(describe(&Event::Panicked { method: "m", message: "boom" }), "`m` panicked: boom");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Panicked
A handler panicked. A request was answered with INTERNAL_ERROR
(without the panic message, which may hold details the peer should not
see); the message is here.
Fields
Invalid
A malformed message arrived: answered with error if it was
request-like, dropped if it was a malformed response to one of our
requests (which then ends with CallError::InvalidResponse).
UnknownNotification
A notification for a method with no notification handler.
Dropped
A notification dropped because it arrived before the
Gate opened.
Unmatched
A response whose id matches none of our outstanding requests (late, repeated, or forged).
PeerError
An error response with a null id: the peer could not read something
we sent.
Fields
error: &'a ErrorObjectThe peer’s error.
Oversized
A message over Limits::max_message_bytes was skipped
unread, and answered with INVALID_REQUEST under a null id.
Fields
error: FrameErrorThe framing error with the sizes.
Cancelled
The peer cancelled one of its requests that was in flight.