Struct rustc_serialize::json::Stack
source · 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 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