[][src]Enum ijson::object::Entry

pub enum Entry<'a> {
    Occupied(OccupiedEntry<'a>),
    Vacant(VacantEntry<'a>),
}

A view into a single entry in an IObject, which may be either vacant or occupied.

Obtained using IObject::entry.

Variants

Occupied(OccupiedEntry<'a>)

An occupied entry.

Vacant(VacantEntry<'a>)

A vacant entry.

Implementations

impl<'a> Entry<'a>[src]

pub fn or_insert(self, default: IValue) -> &'a mut IValue[src]

Fills this entry if it's currently vacant, and then returns a mutable reference to the value at this entry.

pub fn or_insert_with(self, default: impl FnOnce() -> IValue) -> &'a mut IValue[src]

Fills this entry by calling the specified function if it's currently vacant, and then returns a mutable reference to the value at this entry.

pub fn key(&self) -> &IString[src]

Returns a reference to the key at this entry.

pub fn and_modify(self, f: impl FnOnce(&mut IValue)) -> Self[src]

Updates the value in this entry by calling the specified mutation function if the entry is occupied.

Trait Implementations

impl<'a> Debug for Entry<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Entry<'a>

impl<'a> Send for Entry<'a>

impl<'a> Sync for Entry<'a>

impl<'a> Unpin for Entry<'a>

impl<'a> !UnwindSafe for Entry<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.