Struct ruc::err::SimpleError

source ·
pub struct SimpleError<E: Debug + Display + Send + 'static> { /* private fields */ }
Expand description

A pre-impled Error

Implementations§

source§

impl<E: Debug + Display + Send + 'static> SimpleError<E>

source

pub fn new(msg: SimpleMsg<E>, cause: Option<Box<dyn RucError>>) -> Self

Trait Implementations§

source§

impl<E: Debug + Debug + Display + Send + 'static> Debug for SimpleError<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Debug + Display + Send + 'static> Display for SimpleError<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<E: Debug + Display + Send + 'static> From<SimpleError<E>> for Box<dyn RucError>

source§

fn from(e: SimpleError<E>) -> Box<dyn RucError>

Converts to this type from the input type.
source§

impl<E: Debug + Display + Send + 'static> RucError for SimpleError<E>

source§

fn get_top_msg(&self) -> String

get the top-level error message

source§

fn get_lowest_msg(&self) -> String

get the final(lowest) error message

source§

fn type_id(&self) -> TypeId

type id of current error type
source§

fn get_lowest_err(&self) -> &dyn RucError

Get the original error object, used to match its original type by Any.
source§

fn get_top_msg_with_dbginfo(&self) -> String

“error msg” + “debug info”
source§

fn cause(&self) -> Option<&dyn RucError>

point to a error which caused current error
source§

fn type_ids(&self) -> Vec<TypeId>

type ids of errors of each level(from top to bottom).
source§

fn lowest_type_id(&self) -> TypeId

get the type of the lowest(bottom) error
source§

fn lowest_is_type(&self, e: &dyn Any) -> bool

check the type of the lowest error
source§

fn contains_type(&self, e: &dyn Any) -> bool

check if an error exists in the error chain
source§

fn msg_eq(&self, another: &dyn RucError) -> bool

compare two object
source§

fn msg_has_overloop(&self, another: &dyn RucError) -> bool

check if any node from the error_chain matches the given error
source§

fn stringify_chain(&self, prefix: Option<&str>) -> String

generate the final error msg
source§

fn print_die(&self) -> !

Panic after printing error_chain
source§

fn generate_log(&self, prefix: Option<&str>) -> String

Generate the log string
source§

fn generate_log_custom(&self, prefix: Option<&str>) -> String

Generate the log string with custom mode
source§

fn print(&self, prefix: Option<&str>)

Print log

Auto Trait Implementations§

§

impl<E> Freeze for SimpleError<E>
where E: Freeze,

§

impl<E> !RefUnwindSafe for SimpleError<E>

§

impl<E> Send for SimpleError<E>

§

impl<E> !Sync for SimpleError<E>

§

impl<E> Unpin for SimpleError<E>
where E: Unpin,

§

impl<E> !UnwindSafe for SimpleError<E>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> MaybeDebug for T
where T: Debug,