pub struct Entry<K = CompactString, V = Value> {
pub key: K,
pub value: V,
}Expand description
Object entry.
Fields§
§key: KEntry key.
value: VEntry value.
Implementations§
Source§impl<K, V> Entry<K, V>
impl<K, V> Entry<K, V>
Sourcepub fn into_value(self) -> V
pub fn into_value(self) -> V
Consumes this entry, returning its value.
Source§impl Entry
impl Entry
Sourcepub fn get_fragment(&self, index: usize) -> Result<FragmentRef<'_>, usize>
pub fn get_fragment(&self, index: usize) -> Result<FragmentRef<'_>, usize>
Returns the fragment at the given index in traversal order, where
index 0 is the entry itself and index 1 its key.
On failure, returns the number of fragments left to skip.
§Errors
Returns the number of fragments left to skip when index does not resolve
to a fragment within this object.
Trait Implementations§
impl<K, V> Copy for Entry<K, V>
impl<K, V> Eq for Entry<K, V>
Source§impl Extend<Entry> for Object
impl Extend<Entry> for Object
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Entry>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Entry>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬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, V> Ord for Entry<K, V>
impl<K, V> Ord for Entry<K, V>
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<K, V> PartialOrd for Entry<K, V>where
K: PartialOrd,
V: PartialOrd,
impl<K, V> PartialOrd for Entry<K, V>where
K: PartialOrd,
V: PartialOrd,
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> UnsafeUnpin for Entry<K, V>where
K: UnsafeUnpin,
V: UnsafeUnpin,
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Views this value as an
Unordered reference.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if
self is equivalent to key.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.