pub struct Locations { /* private fields */ }Expand description
Location information in the State.
This resolves the input ranges of the events (see
State::input_range) into lines and columns with a SourceMap of the
Source. The source map is built on first use and
cached in the state. Consumers retrieve the resolved span of the current
event with current_span.
Implementations§
Source§impl Locations
impl Locations
Sourcepub fn source_map(state: &mut State) -> Option<Arc<SourceMap>>
pub fn source_map(state: &mut State) -> Option<Arc<SourceMap>>
Returns the source map for the source in the state.
Returns None if the format does not provide the source.
Sourcepub fn current_span(state: &mut State) -> Option<Span>
pub fn current_span(state: &mut State) -> Option<Span>
Returns the span of the current event if the format provides it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Locations
impl RefUnwindSafe for Locations
impl Send for Locations
impl Sync for Locations
impl Unpin for Locations
impl UnsafeUnpin for Locations
impl UnwindSafe for Locations
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