Struct erg_common::error::ErrorCore
source · pub struct ErrorCore {
pub sub_messages: Vec<SubMessage>,
pub main_message: String,
pub errno: usize,
pub kind: ErrorKind,
pub loc: Location,
/* private fields */
}
Expand description
In Erg, common parts used by error. Must be wrap when to use.
Fields§
§sub_messages: Vec<SubMessage>
§main_message: String
§errno: usize
§kind: ErrorKind
§loc: Location
Implementations§
source§impl ErrorCore
impl ErrorCore
pub fn new<S: Into<String>>( sub_messages: Vec<SubMessage>, main_message: S, errno: usize, kind: ErrorKind, loc: Location, ) -> Self
pub fn dummy(errno: usize) -> Self
pub fn unreachable(fn_name: &str, line: u32) -> Self
pub fn bug(errno: usize, loc: Location, fn_name: &str, line: u32) -> Self
pub fn get_loc_with_fallback(&self) -> Location
pub fn get_hint(&self) -> Option<&str>
pub fn fmt_header(&self, color: Color, caused_by: &str, input: &str) -> String
Trait Implementations§
source§impl Error for ErrorCore
impl Error for ErrorCore
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl PartialEq for ErrorCore
impl PartialEq for ErrorCore
impl Eq for ErrorCore
impl StructuralPartialEq for ErrorCore
Auto Trait Implementations§
impl Freeze for ErrorCore
impl RefUnwindSafe for ErrorCore
impl Send for ErrorCore
impl Sync for ErrorCore
impl Unpin for ErrorCore
impl UnwindSafe for ErrorCore
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more