pub enum HandshakeError {
NotAGet(Method),
MissingUpgrade,
NotWebSocket(String),
MissingConnection,
ConnectionNotUpgrade(String),
MissingVersion,
UnsupportedVersion(String),
MissingKey,
MalformedKey(String),
}Expand description
Why a handshake was refused.
Each variant becomes a 400 whose body names the header that was wrong,
because the person reading it is usually holding a half-written client.
Variants§
NotAGet(Method)
MissingUpgrade
NotWebSocket(String)
MissingConnection
ConnectionNotUpgrade(String)
MissingVersion
UnsupportedVersion(String)
MissingKey
MalformedKey(String)
Implementations§
Trait Implementations§
Source§impl Clone for HandshakeError
impl Clone for HandshakeError
Source§impl Debug for HandshakeError
impl Debug for HandshakeError
Source§impl Display for HandshakeError
impl Display for HandshakeError
impl Eq for HandshakeError
Source§impl Error for HandshakeError
impl Error for HandshakeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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()
Source§impl IntoResponse for HandshakeError
A refused handshake answers 400 and says what was wrong, plus the version
header a client would need to retry with — which is what the RFC asks for
and what makes the failure debuggable from the browser console.
impl IntoResponse for HandshakeError
A refused handshake answers 400 and says what was wrong, plus the version
header a client would need to retry with — which is what the RFC asks for
and what makes the failure debuggable from the browser console.
fn into_response(self) -> Response
Source§impl PartialEq for HandshakeError
impl PartialEq for HandshakeError
impl StructuralPartialEq for HandshakeError
Auto Trait Implementations§
impl Freeze for HandshakeError
impl RefUnwindSafe for HandshakeError
impl Send for HandshakeError
impl Sync for HandshakeError
impl Unpin for HandshakeError
impl UnsafeUnpin for HandshakeError
impl UnwindSafe for HandshakeError
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