Enum web_socket::CloseEvent
source · pub enum CloseEvent {
Error(&'static str),
Close {
code: u16,
reason: Box<str>,
},
}Expand description
The CloseEvent enum represents the possible events that can occur when a WebSocket connection is closed.
It has two variants: Error and Close.
Variants§
Error(&'static str)
represents the websocket error message.
Close
Fields
represents a successful close event of the WebSocket connection.
Trait Implementations§
source§impl Debug for CloseEvent
impl Debug for CloseEvent
source§impl Display for CloseEvent
impl Display for CloseEvent
source§impl Error for CloseEvent
impl Error for CloseEvent
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()