pub struct Syntax { /* private fields */ }Expand description
Node positions of a parsed document, for locating values by path.
Implementations§
Source§impl Syntax
impl Syntax
Sourcepub fn locate(&self, path: &[PathSegment]) -> Option<Position>
pub fn locate(&self, path: &[PathSegment]) -> Option<Position>
Where the value at path is written: a scalar at itself, a
collection at its key. A path leaving the document falls back to
its deepest written ancestor. An alias is located at its anchor.
Sourcepub fn locate_expr(
&self,
path: &[PathSegment],
offset: usize,
) -> Option<Position>
pub fn locate_expr( &self, path: &[PathSegment], offset: usize, ) -> Option<Position>
Where char offset of the expression written at path (!!js, or
an expression object in JSON) is.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Syntax
impl Freeze for Syntax
impl Move for Syntax
impl RefUnwindSafe for Syntax
impl Send for Syntax
impl Sync for Syntax
impl Unpin for Syntax
impl UnsafeUnpin for Syntax
impl UnwindSafe for Syntax
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