pub struct Located<E> {
inner: E,
pos: TextRange,
current_file: Option<FileId>,
path: Option<PathBuf>,
file_override: FileOverride,
line_number: u32,
column: u32,
}
Expand description
Wraps an object with location data
Fields§
§inner: E
Inner error, without location information
pos: TextRange
Position at which the error occurred
current_file: Option<FileId>
File identifier for the error
path: Option<PathBuf>
Path corresponding to the file identifier
file_override: FileOverride
Overriden file location
line_number: u32
Resolved line number
column: u32
Resolved column number
Implementations§
source§impl<E> Located<E>
impl<E> Located<E>
sourcepub fn builder() -> LocatedBuilder
pub fn builder() -> LocatedBuilder
Create a builder for this located type
sourcepub fn map<F>(self, f: impl FnOnce(E) -> F) -> Located<F>
pub fn map<F>(self, f: impl FnOnce(E) -> F) -> Located<F>
Transform the inner value wrapped by this instance
§Parameters
f
: function to apply to the inner value
sourcepub fn into_inner(self) -> E
pub fn into_inner(self) -> E
Return the inner value
sourcepub fn current_file(&self) -> Option<FileId>
pub fn current_file(&self) -> Option<FileId>
Get the current file identifier
sourcepub fn set_current_file(&mut self, current_file: FileId)
pub fn set_current_file(&mut self, current_file: FileId)
Set the current file identifier
Trait Implementations§
source§impl<E: Error> Error for Located<E>
impl<E: Error> Error for Located<E>
1.30.0 · 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()
impl<E: Eq> Eq for Located<E>
Auto Trait Implementations§
impl<E> Freeze for Located<E>where
E: Freeze,
impl<E> RefUnwindSafe for Located<E>where
E: RefUnwindSafe,
impl<E> Send for Located<E>where
E: Send,
impl<E> Sync for Located<E>where
E: Sync,
impl<E> Unpin for Located<E>where
E: Unpin,
impl<E> UnwindSafe for Located<E>where
E: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)