pub trait RucError: Display + Debug + Send {
Show 17 methods
// Required methods
fn type_id(&self) -> TypeId;
fn get_top_msg(&self) -> String;
fn get_lowest_msg(&self) -> String;
fn get_lowest_err(&self) -> &dyn RucError;
fn get_top_msg_with_dbginfo(&self) -> String;
// Provided methods
fn type_ids(&self) -> Vec<TypeId> { ... }
fn lowest_type_id(&self) -> TypeId { ... }
fn lowest_is_type(&self, e: &dyn Any) -> bool { ... }
fn contains_type(&self, e: &dyn Any) -> bool { ... }
fn msg_eq(&self, another: &dyn RucError) -> bool { ... }
fn msg_has_overloop(&self, another: &dyn RucError) -> bool { ... }
fn cause(&self) -> Option<&dyn RucError> { ... }
fn stringify_chain(&self, prefix: Option<&str>) -> String { ... }
fn print_die(&self) -> ! { ... }
fn generate_log(&self, prefix: Option<&str>) -> String { ... }
fn generate_log_custom(&self, prefix: Option<&str>) -> String { ... }
fn print(&self, prefix: Option<&str>) { ... }
}
Expand description
the major trait defination
Required Methods§
sourcefn get_top_msg(&self) -> String
fn get_top_msg(&self) -> String
convert the error of current level to string
sourcefn get_lowest_msg(&self) -> String
fn get_lowest_msg(&self) -> String
convert the error of lowest level to string
sourcefn get_lowest_err(&self) -> &dyn RucError
fn get_lowest_err(&self) -> &dyn RucError
Get the original error object,
used to match its original type by Any
.
sourcefn get_top_msg_with_dbginfo(&self) -> String
fn get_top_msg_with_dbginfo(&self) -> String
“error msg” + “debug info”
Provided Methods§
sourcefn lowest_type_id(&self) -> TypeId
fn lowest_type_id(&self) -> TypeId
get the type of the lowest(bottom) error
sourcefn lowest_is_type(&self, e: &dyn Any) -> bool
fn lowest_is_type(&self, e: &dyn Any) -> bool
check the type of the lowest error
sourcefn contains_type(&self, e: &dyn Any) -> bool
fn contains_type(&self, e: &dyn Any) -> bool
check if an error exists in the error chain
sourcefn msg_has_overloop(&self, another: &dyn RucError) -> bool
fn msg_has_overloop(&self, another: &dyn RucError) -> bool
check if any node from the error_chain matches the given error
sourcefn stringify_chain(&self, prefix: Option<&str>) -> String
fn stringify_chain(&self, prefix: Option<&str>) -> String
generate the final error msg
sourcefn generate_log(&self, prefix: Option<&str>) -> String
fn generate_log(&self, prefix: Option<&str>) -> String
Generate the log string
sourcefn generate_log_custom(&self, prefix: Option<&str>) -> String
fn generate_log_custom(&self, prefix: Option<&str>) -> String
Generate the log string with custom mode