pub struct ErrorLocation {
pub file: String,
pub line: u32,
pub column: u32,
pub function_context: String,
pub decrust_variant: Option<String>,
}
Expand description
Specific location for diagnostic purposes
Fields§
§file: String
Path to the file where the error occurred
line: u32
Line number in the file where the error occurred
column: u32
Column number in the file where the error occurred
function_context: String
Function or context string describing where the error occurred
decrust_variant: Option<String>
Optional Snafu error variant name if this location is from a Snafu error
Implementations§
Source§impl ErrorLocation
impl ErrorLocation
Sourcepub fn new(
file: impl Into<String>,
line: u32,
column: u32,
function_context: impl Into<String>,
) -> ErrorLocation
pub fn new( file: impl Into<String>, line: u32, column: u32, function_context: impl Into<String>, ) -> ErrorLocation
Creates a new ErrorLocation with the given file, line, column, and function context
§Parameters
file
- Path to the file where the error occurredline
- Line number in the file where the error occurredcolumn
- Column number in the file where the error occurredfunction_context
- Function or context string describing where the error occurred
Sourcepub fn with_snafu_variant(self, variant: impl Into<String>) -> ErrorLocation
pub fn with_snafu_variant(self, variant: impl Into<String>) -> ErrorLocation
Adds a Snafu error variant name to the error location
§Parameters
variant
- Snafu error variant name
Trait Implementations§
Source§impl Clone for ErrorLocation
impl Clone for ErrorLocation
Source§fn clone(&self) -> ErrorLocation
fn clone(&self) -> ErrorLocation
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 ErrorLocation
impl Debug for ErrorLocation
Source§impl PartialEq for ErrorLocation
impl PartialEq for ErrorLocation
impl Eq for ErrorLocation
impl StructuralPartialEq for ErrorLocation
Auto Trait Implementations§
impl Freeze for ErrorLocation
impl RefUnwindSafe for ErrorLocation
impl Send for ErrorLocation
impl Sync for ErrorLocation
impl Unpin for ErrorLocation
impl UnwindSafe for ErrorLocation
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