[][src]Struct embedded_error_chain::ErrorData

#[repr(transparent)]pub struct ErrorData { /* fields omitted */ }

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]

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]

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

impl Send for ErrorData

impl Sync for ErrorData

impl Unpin for ErrorData

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.