pub struct Stack { /* private fields */ }
Expand description
A Stack represents the current position of the parser in the logical structure of the JSON stream. For example foo.bar[3].x
Implementations§
Source§impl Stack
impl Stack
pub fn new() -> Stack
Sourcepub fn get<'l>(&'l self, idx: usize) -> StackElement<'l>
pub fn get<'l>(&'l self, idx: usize) -> StackElement<'l>
Provides access to the StackElement at a given index. lower indices are at the bottom of the stack while higher indices are at the top.
Sourcepub fn is_equal_to(&self, rhs: &[StackElement<'_>]) -> bool
pub fn is_equal_to(&self, rhs: &[StackElement<'_>]) -> bool
Compares this stack with an array of StackElements.
Sourcepub fn starts_with(&self, rhs: &[StackElement<'_>]) -> bool
pub fn starts_with(&self, rhs: &[StackElement<'_>]) -> bool
Returns true if the bottom-most elements of this stack are the same as the ones passed as parameter.
Sourcepub fn ends_with(&self, rhs: &[StackElement<'_>]) -> bool
pub fn ends_with(&self, rhs: &[StackElement<'_>]) -> bool
Returns true if the top-most elements of this stack are the same as the ones passed as parameter.
Sourcepub fn top<'l>(&'l self) -> Option<StackElement<'l>>
pub fn top<'l>(&'l self) -> Option<StackElement<'l>>
Returns the top-most element (if any).
Auto Trait Implementations§
impl Freeze for Stack
impl RefUnwindSafe for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnwindSafe for Stack
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