pub struct ErrorByte {
pub code: Code,
pub cause: Option<Cause>,
pub detail: bool,
pub message: bool,
}Expand description
An error form’s first byte after its stamp (core 0.92 §7.5), its bits
numbered from 7: the code (7–5), the cause (4–3), whether a detail
follows (2), whether a message follows (1), and the extension bit (0),
which this version leaves 0. So 0xa0 is busy, 0x50 is
unavailable for config, and 0xe4 is app with a detail.
Fields§
§code: Code§cause: Option<Cause>§detail: bool§message: boolImplementations§
Source§impl ErrorByte
impl ErrorByte
Sourcepub fn read(byte: u8) -> Result<ErrorByte, Refusal>
pub fn read(byte: u8) -> Result<ErrorByte, Refusal>
The byte read alone, or the first of §7.5’s checks on it that refuses.
§Errors
Refusal::Cause, Refusal::Detail (ErrorByte::check) or
Refusal::Extension, in that order.
Sourcepub fn check(self) -> Result<(), Refusal>
pub fn check(self) -> Result<(), Refusal>
What §7.5’s parse refuses, and its writer MUST NOT write: a cause
on a code other than unavailable, unavailable without one, then
a detail on a code other than app.
§Errors
Refusal::Cause or Refusal::Detail, in that order.
Trait Implementations§
impl Copy for ErrorByte
impl Eq for ErrorByte
impl StructuralPartialEq for ErrorByte
Auto Trait Implementations§
impl Forget for ErrorByte
impl Freeze for ErrorByte
impl Move for ErrorByte
impl RefUnwindSafe for ErrorByte
impl Send for ErrorByte
impl Sync for ErrorByte
impl Unpin for ErrorByte
impl UnsafeUnpin for ErrorByte
impl UnwindSafe for ErrorByte
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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