pub struct Location {
pub source_name: String,
pub resource: String,
pub line: Option<NonZeroU32>,
pub column: Option<NonZeroU32>,
pub length: Option<NonZeroU32>,
}Expand description
Source and optional position of a configuration value.
Positions are 1-based and stored as NonZeroU32 so that the whole
Location (and therefore crate::Error) stays small enough to return by
value without triggering clippy::result_large_err. Construct via
Location::at, which accepts ordinary usize positions and discards any
out-of-range or zero value as “absent”.
Fields§
§source_name: String§resource: String§line: Option<NonZeroU32>§column: Option<NonZeroU32>§length: Option<NonZeroU32>UTF-8 character span length for error underlines; defaults to one caret.
Implementations§
Trait Implementations§
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<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