pub struct ErrorContext {
pub input: String,
pub backend: String,
pub config: Option<String>,
pub stack_trace: Option<Vec<String>>,
}Expand description
Error context for providing additional information about parsing failures
Fields§
§input: StringInput text that was being parsed
backend: StringCurrent parser backend
config: Option<String>Parser configuration at time of error
stack_trace: Option<Vec<String>>Stack trace or call stack if available
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn with_config(self, config: String) -> Self
pub fn with_config(self, config: String) -> Self
Add configuration information
Sourcepub fn with_stack_trace(self, stack_trace: Vec<String>) -> Self
pub fn with_stack_trace(self, stack_trace: Vec<String>) -> Self
Add stack trace information
Sourcepub fn get_error_snippet(
&self,
position: &SourcePosition,
context_lines: usize,
) -> String
pub fn get_error_snippet( &self, position: &SourcePosition, context_lines: usize, ) -> String
Get a snippet of the input around the error position
Trait Implementations§
Source§impl Clone for ErrorContext
impl Clone for ErrorContext
Source§fn clone(&self) -> ErrorContext
fn clone(&self) -> ErrorContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnsafeUnpin for ErrorContext
impl UnwindSafe for ErrorContext
Blanket Implementations§
impl<T> Allocation for T
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