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 more