pub struct Location {
pub line: u32,
pub column: u32,
pub file: String,
}
Expand description
A set of coordinates to identify a precise spot in a source file.
§Implementation Notes
Location
is an owned version of std::panic::Location
.
You can build a Location
instance starting from a std::panic::Location
:
use pavex_reflection::Location;
let location: Location = std::panic::Location::caller().into();
Fields§
§line: u32
The line number.
Lines are 1-indexed (i.e. the first line is numbered as 1, not 0).
column: u32
The column number.
Columns are 1-indexed (i.e. the first column is numbered as 1, not 0).
file: String
The name of the source file.
Check out std::panic::Location::file
for more details.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Location
impl<'de> Deserialize<'de> for Location
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 UnwindSafe for Location
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