nash_ws/error/mod.rs
1//! nash-ws error module.
2
3/// Specific error to each backend.
4pub type BackendError = crate::backend::Error;
5
6/// All possible errors emitted by the WebSocket.
7#[derive(Debug)]
8pub enum Error {
9 /// Error emitted if the connection fails.
10 ConnectionError(BackendError),
11 /// Error emitted if sending a message fails.
12 SendError(BackendError),
13 /// Error emitted if receiving a message fails.
14 ReceiveError(BackendError)
15}
16
17/// Result type of nash-ws.
18pub type WebsocketResult<T> = Result<T, Error>;