pub struct Location { /* private fields */ }Expand description
The location where a log came from
Implementations§
Source§impl Location
impl Location
Sourcepub fn new(filename: impl ToString, line: u32, col: u32) -> Self
pub fn new(filename: impl ToString, line: u32, col: u32) -> Self
Returns a new custom Location.
You can use this to add a more nuanced location for an error, instead of just letting duat pick one automatically.
An example of this is with treesitter query errors, where
std::panic::Location::caller would return an error within
a rust file, but a more appropriate position would be on the
actual query file.
Sourcepub fn from_panic_location(loc: &Location<'_>) -> Self
pub fn from_panic_location(loc: &Location<'_>) -> Self
Returns a new Location from a regular panic Location
Trait Implementations§
Source§impl Ord for Location
impl Ord for Location
Source§impl PartialOrd for Location
impl PartialOrd for Location
impl Copy for Location
impl Eq for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnsafeUnpin for Location
impl UnwindSafe for Location
Blanket Implementations§
Source§impl<D> AsBuilderPart<D, D> for Dwhere
D: Display,
impl<D> AsBuilderPart<D, D> for Dwhere
D: Display,
Source§fn as_builder_part(&self) -> BuilderPart<'_, D, D>
fn as_builder_part(&self) -> BuilderPart<'_, D, D>
Gets a
BuilderPart fro this valueSource§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