pub struct OakError { /* private fields */ }Expand description
The main error type for the Oak Core parsing framework.
OakError represents all possible language that can occur during
lexical analysis and parsing operations. It provides detailed
error information including error kind and precise source location.
Implementations§
Source§impl OakError
 
impl OakError
Sourcepub fn syntax_error(message: impl Into<String>, source: SourceLocation) -> Self
 
pub fn syntax_error(message: impl Into<String>, source: SourceLocation) -> Self
Sourcepub fn unexpected_character(character: char, source: SourceLocation) -> Self
 
pub fn unexpected_character(character: char, source: SourceLocation) -> Self
Sourcepub fn custom_error(message: impl Into<String>) -> Self
 
pub fn custom_error(message: impl Into<String>) -> Self
Sourcepub fn kind(&self) -> &OakErrorKind
 
pub fn kind(&self) -> &OakErrorKind
Returns a reference to the error kind.
§Returns
A reference to the OakErrorKind enum that categorizes this error.
Trait Implementations§
Source§impl Error for OakError
 
impl Error for OakError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
 
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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 From<OakErrorKind> for OakError
 
impl From<OakErrorKind> for OakError
Source§fn from(kind: OakErrorKind) -> Self
 
fn from(kind: OakErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OakError
impl !RefUnwindSafe for OakError
impl Send for OakError
impl Sync for OakError
impl Unpin for OakError
impl !UnwindSafe for OakError
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