SimpleError

Struct 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 print_die_debug(&self) -> !

Panic after printing error_chain
Source§

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

Generate the log string
Source§

fn generate_log_debug(&self) -> String

Generate log in the original rust debug format
Source§

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

Generate the log string with custom mode
Source§

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

Print log
Source§

fn print_debug(&self)

Print log in rust debug format

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> ToString for T
where T: Display + ?Sized,

Source§

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>,

Source§

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>,

Source§

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.