Struct serde_yaml::Mapping [−][src]
pub struct Mapping { /* fields omitted */ }
Expand description
A YAML mapping in which the keys and values are both serde_yaml::Value
.
Implementations
impl Mapping
[src]
impl Mapping
[src]pub fn with_capacity(capacity: usize) -> Self
[src]
pub fn with_capacity(capacity: usize) -> Self
[src]Creates an empty YAML map with the given initial capacity.
pub fn reserve(&mut self, additional: usize)
[src]
pub fn reserve(&mut self, additional: usize)
[src]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
.
pub fn shrink_to_fit(&mut self)
[src]
pub fn shrink_to_fit(&mut self)
[src]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.
pub fn insert(&mut self, k: Value, v: Value) -> Option<Value>
[src]
pub fn insert(&mut self, k: Value, v: Value) -> Option<Value>
[src]Inserts a key-value pair into the map. If the key already existed, the old value is returned.
pub fn contains_key(&self, k: &Value) -> bool
[src]
pub fn contains_key(&self, k: &Value) -> bool
[src]Checks if the map contains the given key.
pub fn get(&self, k: &Value) -> Option<&Value>
[src]
pub fn get(&self, k: &Value) -> Option<&Value>
[src]Returns the value corresponding to the key in the map.
pub fn get_mut(&mut self, k: &Value) -> Option<&mut Value>
[src]
pub fn get_mut(&mut self, k: &Value) -> Option<&mut Value>
[src]Returns the mutable reference corresponding to the key in the map.
pub fn remove(&mut self, k: &Value) -> Option<Value>
[src]
pub fn remove(&mut self, k: &Value) -> Option<Value>
[src]Removes and returns the value corresponding to the key from the map.
pub fn capacity(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]Returns the maximum number of key-value pairs the map can hold without reallocating.
Trait Implementations
impl<'de> Deserialize<'de> for Mapping
[src]
impl<'de> Deserialize<'de> for Mapping
[src]fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Extend<(Value, Value)> for Mapping
[src]
impl Extend<(Value, Value)> for Mapping
[src]fn extend<I: IntoIterator<Item = (Value, Value)>>(&mut self, iter: I)
[src]
fn extend<I: IntoIterator<Item = (Value, Value)>>(&mut self, iter: I)
[src]Extends a collection with the contents of an iterator. Read more
fn extend_one(&mut self, item: A)
[src]
fn extend_one(&mut self, item: A)
[src]extend_one
)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl<'a> IntoIterator for &'a Mapping
[src]
impl<'a> IntoIterator for &'a Mapping
[src]impl<'a> IntoIterator for &'a mut Mapping
[src]
impl<'a> IntoIterator for &'a mut Mapping
[src]impl IntoIterator for Mapping
[src]
impl IntoIterator for Mapping
[src]impl PartialOrd<Mapping> for Mapping
[src]
impl PartialOrd<Mapping> for Mapping
[src]fn partial_cmp(&self, other: &Mapping) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Mapping) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Mapping
[src]
impl StructuralEq for Mapping
[src]
impl StructuralPartialEq for Mapping
[src]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,