Struct holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::dependencies::serde_yaml::value::Mapping
source · pub struct Mapping { /* private fields */ }
Expand description
A YAML mapping in which the keys and values are both serde_yaml::Value
.
Implementations
sourceimpl Mapping
impl Mapping
sourcepub fn with_capacity(capacity: usize) -> Mapping
pub fn with_capacity(capacity: usize) -> Mapping
Creates an empty YAML map with the given initial capacity.
sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
more elements to be inserted
into the map. The map may reserve more space to avoid frequent
allocations.
Panics
Panics if the new allocation size overflows usize
.
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the map as much as possible. It will drop down as much as possible while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.
sourcepub fn insert(&mut self, k: Value, v: Value) -> Option<Value>
pub fn insert(&mut self, k: Value, v: Value) -> Option<Value>
Inserts a key-value pair into the map. If the key already existed, the old value is returned.
sourcepub fn contains_key<I>(&self, index: I) -> boolwhere
I: Index,
pub fn contains_key<I>(&self, index: I) -> boolwhere
I: Index,
Checks if the map contains the given key.
sourcepub fn get<I>(&self, index: I) -> Option<&Value>where
I: Index,
pub fn get<I>(&self, index: I) -> Option<&Value>where
I: Index,
Returns the value corresponding to the key in the map.
sourcepub fn get_mut<I>(&mut self, index: I) -> Option<&mut Value>where
I: Index,
pub fn get_mut<I>(&mut self, index: I) -> Option<&mut Value>where
I: Index,
Returns the mutable reference corresponding to the key in the map.
sourcepub fn entry(&mut self, k: Value) -> Entry<'_>
pub fn entry(&mut self, k: Value) -> Entry<'_>
Gets the given key’s corresponding entry in the map for insertion and/or in-place manipulation.
sourcepub fn remove<I>(&mut self, index: I) -> Option<Value>where
I: Index,
pub fn remove<I>(&mut self, index: I) -> Option<Value>where
I: Index,
Removes and returns the value corresponding to the key from the map.
sourcepub fn remove_entry<I>(&mut self, index: I) -> Option<(Value, Value)>where
I: Index,
pub fn remove_entry<I>(&mut self, index: I) -> Option<(Value, Value)>where
I: Index,
Remove and return the key-value pair.
sourcepub fn retain<F>(&mut self, keep: F)where
F: FnMut(&Value, &mut Value) -> bool,
pub fn retain<F>(&mut self, keep: F)where
F: FnMut(&Value, &mut Value) -> bool,
Scan through each key-value pair in the map and keep those where the
closure keep
returns true.
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the maximum number of key-value pairs the map can hold without reallocating.
sourcepub fn iter(&self) -> Iter<'_> ⓘ
pub fn iter(&self) -> Iter<'_> ⓘ
Returns a double-ended iterator visiting all key-value pairs in order of
insertion. Iterator element type is (&'a Value, &'a Value)
.
sourcepub fn iter_mut(&mut self) -> IterMut<'_> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_> ⓘ
Returns a double-ended iterator visiting all key-value pairs in order of
insertion. Iterator element type is (&'a Value, &'a mut ValuE)
.
sourcepub fn values_mut(&mut self) -> ValuesMut<'_> ⓘ
pub fn values_mut(&mut self) -> ValuesMut<'_> ⓘ
Return an iterator over mutable references to the values of the map.
sourcepub fn into_values(self) -> IntoValues ⓘ
pub fn into_values(self) -> IntoValues ⓘ
Return an owning iterator over the values of the map.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Mapping
impl<'de> Deserialize<'de> for Mapping
sourcefn deserialize<D>(
deserializer: D
) -> Result<Mapping, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Mapping, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
sourceimpl Extend<(Value, Value)> for Mapping
impl Extend<(Value, Value)> for Mapping
sourcefn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (Value, Value)>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = (Value, Value)>,
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)sourceimpl FromIterator<(Value, Value)> for Mapping
impl FromIterator<(Value, Value)> for Mapping
sourceimpl<'a> IntoIterator for &'a Mapping
impl<'a> IntoIterator for &'a Mapping
sourceimpl<'a> IntoIterator for &'a mut Mapping
impl<'a> IntoIterator for &'a mut Mapping
sourceimpl IntoIterator for Mapping
impl IntoIterator for Mapping
sourceimpl PartialOrd<Mapping> for Mapping
impl PartialOrd<Mapping> for Mapping
sourcefn partial_cmp(&self, other: &Mapping) -> Option<Ordering>
fn partial_cmp(&self, other: &Mapping) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl Serialize for Mapping
impl Serialize for Mapping
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl Eq for Mapping
impl StructuralEq for Mapping
impl StructuralPartialEq for Mapping
Auto Trait Implementations
impl RefUnwindSafe for Mapping
impl Send for Mapping
impl Sync for Mapping
impl Unpin for Mapping
impl UnwindSafe for Mapping
Blanket Implementations
impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
sourcefn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
sourcefn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.