Struct ratchet_rs::Error
source · [−]pub struct Error { /* private fields */ }
Expand description
The errors that may occur during a WebSocket connection.
Implementations
sourceimpl 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 where
E: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
pub fn with_cause<E>(kind: ErrorKind, source: E) -> Error where
E: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
Construct a new error with the provided kind and a cause.
sourcepub fn downcast_ref<T>(&self) -> Option<&T> where
T: Any + Error,
pub fn downcast_ref<T>(&self) -> Option<&T> where
T: Any + Error,
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
sourceimpl Error for Error
impl Error for Error
sourcefn 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 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
sourcefn from(e: FromUtf8Error) -> Error
fn from(e: FromUtf8Error) -> Error
Converts to this type from the input type.
sourceimpl From<Infallible> for Error
impl From<Infallible> for Error
sourcefn from(e: Infallible) -> Error
fn from(e: Infallible) -> Error
Converts to this type from the input type.
sourceimpl From<InvalidHeader> for Error
impl From<InvalidHeader> for Error
sourcefn from(e: InvalidHeader) -> Error
fn from(e: InvalidHeader) -> Error
Converts to this type from the input type.
sourceimpl From<InvalidHeaderValue> for Error
impl From<InvalidHeaderValue> for Error
sourcefn from(e: InvalidHeaderValue) -> Error
fn from(e: InvalidHeaderValue) -> Error
Converts to this type from the input type.
sourceimpl From<InvalidStatusCode> for Error
impl From<InvalidStatusCode> for Error
sourcefn from(e: InvalidStatusCode) -> Error
fn from(e: InvalidStatusCode) -> Error
Converts to this type from the input type.
sourceimpl From<InvalidUri> for Error
impl From<InvalidUri> for Error
sourcefn from(e: InvalidUri) -> Error
fn from(e: InvalidUri) -> Error
Converts to this type from the input type.
sourceimpl From<ProtocolError> for Error
impl From<ProtocolError> for Error
sourcefn from(e: ProtocolError) -> Error
fn from(e: ProtocolError) -> Error
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more