Struct ratchet_rs::Error
source · pub struct Error { /* private fields */ }
Expand description
The errors that may occur during a WebSocket connection.
Implementations§
source§impl Error
impl Error
sourcepub fn new(kind: ErrorKind) -> Error
pub fn new(kind: ErrorKind) -> Error
Construct a new error with the provided kind and no cause.
sourcepub fn with_cause<E>(kind: ErrorKind, source: E) -> Error
pub fn with_cause<E>(kind: ErrorKind, source: E) -> Error
Construct a new error with the provided kind and a cause.
sourcepub fn downcast_ref<T>(&self) -> Option<&T>
pub fn downcast_ref<T>(&self) -> Option<&T>
Returns some reference to the boxed value if it is of type T, or None if it isn’t.
sourcepub fn is_extension(&self) -> bool
pub fn is_extension(&self) -> bool
Whether this error is related to an extension error.
sourcepub fn is_protocol(&self) -> bool
pub fn is_protocol(&self) -> bool
Whether this error is related to a protocol error.
sourcepub fn is_encoding(&self) -> bool
pub fn is_encoding(&self) -> bool
Whether this error is related to an encoding error.
Trait Implementations§
source§impl Error for Error
impl Error for Error
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()
source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
source§fn from(e: FromUtf8Error) -> Error
fn from(e: FromUtf8Error) -> Error
Converts to this type from the input type.
source§impl From<Infallible> for Error
impl From<Infallible> for Error
source§fn from(e: Infallible) -> Error
fn from(e: Infallible) -> Error
Converts to this type from the input type.
source§impl From<InvalidHeader> for Error
impl From<InvalidHeader> for Error
source§fn from(e: InvalidHeader) -> Error
fn from(e: InvalidHeader) -> Error
Converts to this type from the input type.
source§impl From<InvalidHeaderValue> for Error
impl From<InvalidHeaderValue> for Error
source§fn from(e: InvalidHeaderValue) -> Error
fn from(e: InvalidHeaderValue) -> Error
Converts to this type from the input type.
source§impl From<InvalidStatusCode> for Error
impl From<InvalidStatusCode> for Error
source§fn from(e: InvalidStatusCode) -> Error
fn from(e: InvalidStatusCode) -> Error
Converts to this type from the input type.
source§impl From<InvalidUri> for Error
impl From<InvalidUri> for Error
source§fn from(e: InvalidUri) -> Error
fn from(e: InvalidUri) -> Error
Converts to this type from the input type.
source§impl From<ProtocolError> for Error
impl From<ProtocolError> for Error
source§fn from(e: ProtocolError) -> Error
fn from(e: ProtocolError) -> Error
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more