pub struct ObjectView<'a> { /* private fields */ }Expand description
Borrowed view over an object (JSONParser.h:239 JSONObject). Grown in B3
with name lookups + iteration.
Implementations§
Source§impl<'a> ObjectView<'a>
impl<'a> ObjectView<'a>
Returns the hidden class descriptor shared among same-shape objects.
Sourcepub fn get(&self, name: &str, atoms: &AtomTable) -> Option<&'a JSONValue<'a>>
pub fn get(&self, name: &str, atoms: &AtomTable) -> Option<&'a JSONValue<'a>>
JSONParser.h:286 — value for name, or None.
Sourcepub fn at(&self, name: &str, atoms: &AtomTable) -> &'a JSONValue<'a>
pub fn at(&self, name: &str, atoms: &AtomTable) -> &'a JSONValue<'a>
JSONParser.h:295 — value for name; panics if absent (C++ asserts).
Sourcepub fn count(&self, name: &str, atoms: &AtomTable) -> usize
pub fn count(&self, name: &str, atoms: &AtomTable) -> usize
JSONParser.h:323 — 1 if present else 0.
Sourcepub fn value_at(&self, index: usize) -> &'a JSONValue<'a>
pub fn value_at(&self, index: usize) -> &'a JSONValue<'a>
Value by position (0..size). Panics if out of range.
Sourcepub fn key_at(&self, index: usize) -> AtomBytes
pub fn key_at(&self, index: usize) -> AtomBytes
Key (interned handle) by position. Panics if out of range.
Auto Trait Implementations§
impl<'a> Freeze for ObjectView<'a>
impl<'a> RefUnwindSafe for ObjectView<'a>
impl<'a> Send for ObjectView<'a>
impl<'a> Sync for ObjectView<'a>
impl<'a> Unpin for ObjectView<'a>
impl<'a> UnsafeUnpin for ObjectView<'a>
impl<'a> UnwindSafe for ObjectView<'a>
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