pub struct ArrayIterator<'read, 'parent, R: Read<'read>, S: Stack> { /* private fields */ }Expand description
An iterator over an array.
Implementations§
Source§impl<'read, 'parent, R: Read<'read>, S: Stack> ArrayIterator<'read, 'parent, R, S>
impl<'read, 'parent, R: Read<'read>, S: Stack> ArrayIterator<'read, 'parent, R, S>
Sourcepub fn next(
&mut self,
) -> Option<Result<Value<'read, '_, R, S>, JsonError<'read, R, S>>>
pub fn next( &mut self, ) -> Option<Result<Value<'read, '_, R, S>, JsonError<'read, R, S>>>
The next item within the array.
This is approximate to Iterator::next yet each item maintains a mutable reference to the
iterator. Accordingly, we cannot use Iterator::next which requires items not borrow from
the iterator.
polonius-the-crab details a frequent limitation of Rust’s borrow checker which users of this function may incur. It also details potential solutions (primarily using inlined code instead of functions, callbacks) before presenting itself as a complete solution. Please refer to it if you have difficulties calling this method for context.
Trait Implementations§
Auto Trait Implementations§
impl<'read, 'parent, R, S> Freeze for ArrayIterator<'read, 'parent, R, S>
impl<'read, 'parent, R, S> RefUnwindSafe for ArrayIterator<'read, 'parent, R, S>where
S: RefUnwindSafe,
R: RefUnwindSafe,
<R as Read<'read>>::Error: RefUnwindSafe,
<S as Stack>::Error: RefUnwindSafe,
impl<'read, 'parent, R, S> Send for ArrayIterator<'read, 'parent, R, S>
impl<'read, 'parent, R, S> Sync for ArrayIterator<'read, 'parent, R, S>
impl<'read, 'parent, R, S> Unpin for ArrayIterator<'read, 'parent, R, S>
impl<'read, 'parent, R, S> !UnwindSafe for ArrayIterator<'read, 'parent, R, S>
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