pub struct Error { /* private fields */ }Available on crate feature
api only.Expand description
An error raised when encoding or decoding a message.
Implementations§
Source§impl Error
impl Error
Sourcepub fn unsupported_format(&self) -> Option<Format>
pub fn unsupported_format(&self) -> Option<Format>
Test if the error is caused by a format which is not supported, and if so return it.
Sourcepub fn unsupported_version(&self) -> Option<u32>
pub fn unsupported_version(&self) -> Option<u32>
Test if the error is caused by a peer speaking a different version of the protocol, and if so return the version it stated.
A session between peers which do not agree on this is refused before either of them has acted on anything the other said, see the protocol version.
Sourcepub fn is_unknown_header(&self) -> bool
pub fn is_unknown_header(&self) -> bool
Test if the error is caused by a header this build does not know about.
A peer which writes one is speaking a protocol this build has never seen, which is never something to carry on through.
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)>
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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
impl<Token, Builder, How> AllPropsFor<Builder, How> for Tokenwhere
Builder: Buildable<Token>,
<Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,
impl<Token, Builder, How> AllPropsFor<Builder, How> for Tokenwhere
Builder: Buildable<Token>,
<Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> HasAllProps<(), T> for T
impl<T> HasAllProps<(), T> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<E> ResponseError for E
impl<E> ResponseError for E
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Available on crate feature
ws only.Write the human readable message of the error. Read more
Source§fn encode_payload(&self, payload: ErrorPayload<'_>) -> Result<(), Error>
fn encode_payload(&self, payload: ErrorPayload<'_>) -> Result<(), Error>
Available on crate feature
ws only.Encode the typed payload of the error, if it has one, by calling
ErrorPayload::encode. Read more