pub struct IndexedViewList<'a, T: JsonView> { /* private fields */ }Expand description
ViewList after ViewList::index — O(1) element access by index.
Spans stay zero-copy into the parent buffer; only the offset table is owned.
Implementations§
Source§impl<'a, T: JsonView> IndexedViewList<'a, T>
impl<'a, T: JsonView> IndexedViewList<'a, T>
pub fn is_empty(&self) -> bool
Sourcepub fn get_raw(&self, index: usize) -> Result<&'a [u8], Error>
pub fn get_raw(&self, index: usize) -> Result<&'a [u8], Error>
Raw element span at index (O(1)).
Sourcepub fn get(&self, index: usize) -> Result<T, Error>
pub fn get(&self, index: usize) -> Result<T, Error>
Decode element index as T (O(1) hop + decode).
Sourcepub fn iter(&self) -> impl Iterator<Item = Result<T, Error>> + '_
pub fn iter(&self) -> impl Iterator<Item = Result<T, Error>> + '_
Iterate decoded elements (same order as the array).
pub fn each<F>(&self, f: F) -> Result<(), Error>
pub fn collect_owned(&self) -> Result<Vec<T>, Error>
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for IndexedViewList<'a, T>
impl<'a, T> RefUnwindSafe for IndexedViewList<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for IndexedViewList<'a, T>where
T: Send,
impl<'a, T> Sync for IndexedViewList<'a, T>where
T: Sync,
impl<'a, T> Unpin for IndexedViewList<'a, T>where
T: Unpin,
impl<'a, T> UnsafeUnpin for IndexedViewList<'a, T>
impl<'a, T> UnwindSafe for IndexedViewList<'a, T>where
T: UnwindSafe,
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