pub struct ErrorContext {
pub line: usize,
pub column: usize,
pub source_snippet: String,
pub source_file: Option<String>,
}Expand description
Context information for error reporting with source snippets
Fields§
§line: usizeLine number where the error occurred
column: usizeColumn number where the error occurred
source_snippet: StringSource snippet showing 3 lines of context around the error
source_file: Option<String>Optional source file name
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn with_snippet(line: usize, column: usize, source: &str) -> Self
pub fn with_snippet(line: usize, column: usize, source: &str) -> Self
Creates an error context with source snippet
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorContext
impl Debug for ErrorContext
Source§impl PartialEq for ErrorContext
impl PartialEq for ErrorContext
impl StructuralPartialEq for ErrorContext
Auto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnwindSafe for ErrorContext
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