Enum tide_disco::socket::SocketError
source · pub enum SocketError<E> {
AppSpecific(E),
Request(RequestError),
Binary(Error),
Json(Error),
WebSockets(Error),
UnsupportedMessageType,
Closed,
IncorrectMethod {
expected: Method,
actual: Method,
},
}Expand description
An error returned by a socket handler.
SocketError encapsulates application specific errors E returned by the user-installed
handler itself. It also includes errors in the socket protocol, such as failures to turn
messages sent by the user-installed handler into WebSockets messages.
Variants§
AppSpecific(E)
Request(RequestError)
Binary(Error)
Json(Error)
WebSockets(Error)
UnsupportedMessageType
Closed
IncorrectMethod
Implementations§
source§impl<E> SocketError<E>
impl<E> SocketError<E>
pub fn status(&self) -> StatusCode
pub fn code(&self) -> CloseCode
pub fn map_app_specific<E2>(self, f: &impl Fn(E) -> E2) -> SocketError<E2>
Trait Implementations§
source§impl<E: Debug> Debug for SocketError<E>
impl<E: Debug> Debug for SocketError<E>
source§impl<E: Display> Display for SocketError<E>
impl<E: Display> Display for SocketError<E>
source§impl<E> From<Error> for SocketError<E>
impl<E> From<Error> for SocketError<E>
source§impl<E> From<Error> for SocketError<E>
impl<E> From<Error> for SocketError<E>
source§impl<E> From<Error> for SocketError<E>
impl<E> From<Error> for SocketError<E>
source§impl<E> From<RequestError> for SocketError<E>
impl<E> From<RequestError> for SocketError<E>
source§fn from(err: RequestError) -> Self
fn from(err: RequestError) -> Self
Converts to this type from the input type.
source§impl<E: Display> From<SocketError<E>> for ServerError
impl<E: Display> From<SocketError<E>> for ServerError
source§fn from(source: SocketError<E>) -> Self
fn from(source: SocketError<E>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<E> Freeze for SocketError<E>where
E: Freeze,
impl<E> !RefUnwindSafe for SocketError<E>
impl<E> Send for SocketError<E>where
E: Send,
impl<E> Sync for SocketError<E>where
E: Sync,
impl<E> Unpin for SocketError<E>where
E: Unpin,
impl<E> !UnwindSafe for SocketError<E>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more