Struct json_syntax::object::Entry
source · pub struct Entry<M = ()> {
pub key: Meta<Key, M>,
pub value: MetaValue<M>,
}
Expand description
Object entry.
Fields§
§key: Meta<Key, M>
§value: MetaValue<M>
Implementations§
source§impl<M> Entry<M>
impl<M> Entry<M>
pub fn new(key: Meta<Key, M>, value: MetaValue<M>) -> Self
pub fn as_key(&self) -> &Meta<Key, M>
pub fn as_value(&self) -> &MetaValue<M>
pub fn into_key(self) -> Meta<Key, M>
pub fn into_value(self) -> MetaValue<M>
pub fn stripped_key(&self) -> &Key
pub fn stripped_value(&self) -> &Value<M>
pub fn into_stripped_key(self) -> Key
pub fn into_stripped_value(self) -> Value<M>
pub fn key_metadata(&self) -> &M
pub fn value_metadata(&self) -> &M
pub fn into_key_metadata(self) -> M
pub fn into_value_metadata(self) -> M
pub fn map_metadata<N>(self, f: impl FnMut(M) -> N) -> Entry<N>
pub fn try_map_metadata<N, E>( self, f: impl FnMut(M) -> Result<N, E> ) -> Result<Entry<N>, E>
pub fn as_pair(&self) -> (&Meta<Key, M>, &MetaValue<M>)
Trait Implementations§
source§impl<M> Extend<Entry<M>> for Object<M>
impl<M> Extend<Entry<M>> for Object<M>
source§fn extend<I: IntoIterator<Item = Entry<M>>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Entry<M>>>(&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<M> FromIterator<Entry<M>> for Object<M>
impl<M> FromIterator<Entry<M>> for Object<M>
source§impl<M: Ord> Ord for Entry<M>
impl<M: Ord> Ord for Entry<M>
source§impl<M: PartialEq> PartialEq<Entry<M>> for Entry<M>
impl<M: PartialEq> PartialEq<Entry<M>> for Entry<M>
source§impl<M: PartialOrd> PartialOrd<Entry<M>> for Entry<M>
impl<M: PartialOrd> PartialOrd<Entry<M>> for Entry<M>
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 moresource§impl<M> StrippedHash for Entry<M>
impl<M> StrippedHash for Entry<M>
fn stripped_hash<H: Hasher>(&self, state: &mut H)
source§impl<M> StrippedOrd for Entry<M>
impl<M> StrippedOrd for Entry<M>
fn stripped_cmp(&self, other: &Self) -> Ordering
source§impl<M, __M> StrippedPartialEq<Entry<__M>> for Entry<M>
impl<M, __M> StrippedPartialEq<Entry<__M>> for Entry<M>
fn stripped_eq(&self, other: &Entry<__M>) -> bool
source§impl<M, __M> StrippedPartialOrd<Entry<__M>> for Entry<M>
impl<M, __M> StrippedPartialOrd<Entry<__M>> for Entry<M>
impl<M: Eq> Eq for Entry<M>
impl<M> StrippedEq for Entry<M>
impl<M> StructuralEq for Entry<M>
impl<M> StructuralPartialEq for Entry<M>
Auto Trait Implementations§
impl<M> RefUnwindSafe for Entry<M>where M: RefUnwindSafe,
impl<M> Send for Entry<M>where M: Send,
impl<M> Sync for Entry<M>where M: Sync,
impl<M> Unpin for Entry<M>where M: Unpin,
impl<M> UnwindSafe for Entry<M>where M: 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