Field

Struct Field 

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

A field within an object.

Implementations§

Source§

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

Source

pub fn key( &mut self, ) -> &mut (impl use<'read, 'parent, R, S> + Iterator<Item = Result<char, JsonError<'read, R, S>>>)

Access the iterator for the string used as the field’s key.

The iterator will yield the individual characters within the string represented by the JSON serialization, with all escape sequences handled.

If the JSON underlying is invalid, the iterator will error, and while Field::value may still be called, all further attempted accesses will yield an error.

If the JSON underlying is valid yet does not represent a valid UTF-8 sequence, the iterator will error, yet Field::value may still be called and deserialization may continue. The rest of the key will not be accessible however.

Source

pub fn value(self) -> Value<'read, 'parent, R, S>

Access the field’s value.

Trait Implementations§

Source§

impl<'read, 'parent, R: Read<'read>, S: Stack> Drop for Field<'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 Field<'read, 'parent, R, S>

§

impl<'read, 'parent, R, S> RefUnwindSafe for Field<'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 Field<'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 Field<'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 Field<'read, 'parent, R, S>

§

impl<'read, 'parent, R, S> !UnwindSafe for Field<'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.