Struct json_syntax::object::Entry
source · pub struct Entry<K = Key, V = Value> {
pub key: K,
pub value: V,
}
Expand description
Object entry.
Fields§
§key: K
§value: V
Implementations§
source§impl<K, V> Entry<K, V>
impl<K, V> Entry<K, V>
pub fn new(key: K, value: V) -> Self
pub fn as_key(&self) -> &K
pub fn as_value(&self) -> &V
pub fn into_key(self) -> K
pub fn into_value(self) -> V
pub fn as_pair(&self) -> (&K, &V)
pub fn into_pair(self) -> (K, V)
pub fn as_ref(&self) -> Entry<&K, &V>
pub fn into_mapped( self, key_offset: usize, value_offset: usize, ) -> Entry<Mapped<K>, Mapped<V>>
source§impl Entry
impl Entry
pub fn get_fragment(&self, index: usize) -> Result<FragmentRef<'_>, usize>
Trait Implementations§
source§impl Extend<Entry> for Object
impl Extend<Entry> for Object
source§fn extend<I: IntoIterator<Item = Entry>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Entry>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl FromIterator<Entry> for Object
impl FromIterator<Entry> for Object
source§impl<K: Ord, V: Ord> Ord for Entry<K, V>
impl<K: Ord, V: Ord> Ord for Entry<K, V>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<K: PartialEq, V: PartialEq> PartialEq for Entry<K, V>
impl<K: PartialEq, V: PartialEq> PartialEq for Entry<K, V>
source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for Entry<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for Entry<K, V>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<K: Copy, V: Copy> Copy for Entry<K, V>
impl<K: Eq, V: Eq> Eq for Entry<K, V>
impl<K, V> StructuralPartialEq for Entry<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Entry<K, V>
impl<K, V> RefUnwindSafe for Entry<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Entry<K, V>
impl<K, V> Sync for Entry<K, V>
impl<K, V> Unpin for Entry<K, V>
impl<K, V> UnwindSafe for Entry<K, V>where
K: UnwindSafe,
V: 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