FieldIterator

Struct FieldIterator 

Source
pub struct FieldIterator<'read, 'parent, R: Read<'read>, S: Stack> { /* private fields */ }
Expand description

An iterator over fields.

Implementations§

Source§

impl<'read, 'parent, R: Read<'read>, S: Stack> FieldIterator<'read, 'parent, R, S>

Source

pub fn next( &mut self, ) -> Option<Result<Field<'read, '_, R, S>, JsonError<'read, R, S>>>

The next field within the object.

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§

Source§

impl<'read, 'parent, R: Read<'read>, S: Stack> Drop for FieldIterator<'read, 'parent, R, S>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'read, 'parent, R, S> Freeze for FieldIterator<'read, 'parent, R, S>

§

impl<'read, 'parent, R, S> RefUnwindSafe for FieldIterator<'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 FieldIterator<'read, 'parent, R, S>
where S: Send, R: Send, <R as Read<'read>>::Error: Send, <S as Stack>::Error: Send,

§

impl<'read, 'parent, R, S> Sync for FieldIterator<'read, 'parent, R, S>
where S: Sync, R: Sync, <R as Read<'read>>::Error: Sync, <S as Stack>::Error: Sync,

§

impl<'read, 'parent, R, S> Unpin for FieldIterator<'read, 'parent, R, S>

§

impl<'read, 'parent, R, S> !UnwindSafe for FieldIterator<'read, 'parent, R, S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.