pub struct JsonSourceLocator { /* private fields */ }Expand description
Locates positions in JSON source text.
Maps JSON Pointer paths to their source locations (line/column) in the original JSON document.
Implementations§
Source§impl JsonSourceLocator
impl JsonSourceLocator
Sourcepub fn new(json_text: &str) -> Self
pub fn new(json_text: &str) -> Self
Creates a new source locator by parsing the given JSON text.
Sourcepub fn get_location(&self, path: impl AsRef<str>) -> JsonLocation
pub fn get_location(&self, path: impl AsRef<str>) -> JsonLocation
Gets the source location for a JSON Pointer path.
Sourcepub fn has_location(&self, path: &str) -> bool
pub fn has_location(&self, path: &str) -> bool
Returns true if the locator has a location for the given path.
Trait Implementations§
Source§impl Clone for JsonSourceLocator
impl Clone for JsonSourceLocator
Source§fn clone(&self) -> JsonSourceLocator
fn clone(&self) -> JsonSourceLocator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonSourceLocator
impl Debug for JsonSourceLocator
Source§impl Default for JsonSourceLocator
impl Default for JsonSourceLocator
Source§fn default() -> JsonSourceLocator
fn default() -> JsonSourceLocator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JsonSourceLocator
impl RefUnwindSafe for JsonSourceLocator
impl Send for JsonSourceLocator
impl Sync for JsonSourceLocator
impl Unpin for JsonSourceLocator
impl UnwindSafe for JsonSourceLocator
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