pub struct ErrorSource {
pub file: String,
pub line: u32,
pub module_path: String,
pub column: Option<u32>,
pub function: Option<String>,
}
Expand description
Describes the source location of an error
Fields§
§file: String
Path to the file where the error occurred
line: u32
Line number in the file where the error occurred
module_path: String
Module path (e.g., “crate::module::submodule”)
column: Option<u32>
Optional column number for more precise location
function: Option<String>
Optional function name where the error occurred
Implementations§
Source§impl ErrorSource
impl ErrorSource
Sourcepub fn new(
file: impl Into<String>,
line: u32,
module_path: impl Into<String>,
) -> ErrorSource
pub fn new( file: impl Into<String>, line: u32, module_path: impl Into<String>, ) -> ErrorSource
Creates a new ErrorSource with the given file, line, and module path
§Parameters
file
- Path to the file where the error occurredline
- Line number in the file where the error occurredmodule_path
- Module path (e.g., “crate::module::submodule”)
Sourcepub fn with_column(self, column: u32) -> ErrorSource
pub fn with_column(self, column: u32) -> ErrorSource
Adds a column number to the error source location
§Parameters
column
- Column number for more precise location
Sourcepub fn with_function(self, function: impl Into<String>) -> ErrorSource
pub fn with_function(self, function: impl Into<String>) -> ErrorSource
Adds a function name to the error source location
§Parameters
function
- Function name where the error occurred
Trait Implementations§
Source§impl Clone for ErrorSource
impl Clone for ErrorSource
Source§fn clone(&self) -> ErrorSource
fn clone(&self) -> ErrorSource
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 ErrorSource
impl Debug for ErrorSource
Source§impl PartialEq for ErrorSource
impl PartialEq for ErrorSource
impl Eq for ErrorSource
impl StructuralPartialEq for ErrorSource
Auto Trait Implementations§
impl Freeze for ErrorSource
impl RefUnwindSafe for ErrorSource
impl Send for ErrorSource
impl Sync for ErrorSource
impl Unpin for ErrorSource
impl UnwindSafe for ErrorSource
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