[−][src]Struct embedded_error_chain::ErrorData
The entire data of the error and its error code chain.
Implementations
impl ErrorData
[src]
pub const fn new(error_code: ErrorCode) -> ErrorData
[src]
Create new ErrorData
that conains the supplied error_code
and has an empty chain.
pub fn set_code(&mut self, code: ErrorCode) -> ErrorCode
[src]
Replace the error code with code
and return the old one.
Note: That the categories of the new error code and the old must be the same.
pub fn code(&self) -> ErrorCode
[src]
Get the error code of the error.
pub fn first_formatter_index(&self) -> Option<u8>
[src]
Get the first formatter index in the chain if available.
pub fn chain_len(&self) -> usize
[src]
The number of chained error codes (does not include the error code representing this error).
pub fn chain_full(&self) -> bool
[src]
Wether the error chain is full.
pub fn push_front(
&mut self,
error_code: ErrorCode,
category_index: u8
) -> Option<(ErrorCode, u8)>
[src]
&mut self,
error_code: ErrorCode,
category_index: u8
) -> Option<(ErrorCode, u8)>
Push onto the front of the error chain, return the back of the chain before and if it gets overwritten (when the chain overflows).
Note: error_code
is masked to the first 4 bits and category_index
is masked to
the first 3 bits.
pub fn chain(&mut self, error_code: ErrorCode, category_index: u8)
[src]
Chain this error with a new error specified by error_code
and category_index
.
TODO: document
Trait Implementations
impl Clone for ErrorData
[src]
fn clone(&self) -> ErrorData
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ErrorData
[src]
impl Eq for ErrorData
[src]
impl PartialEq<ErrorData> for ErrorData
[src]
impl StructuralEq for ErrorData
[src]
impl StructuralPartialEq for ErrorData
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,