[][src]Struct serde_yaml::Mapping

pub struct Mapping { /* fields omitted */ }

A YAML mapping in which the keys and values are both serde_yaml::Value.

Methods

impl Mapping
[src]

Creates an empty YAML map.

Creates an empty YAML map with the given initial capacity.

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.

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.

Inserts a key-value pair into the map. If the key already existed, the old value is returned.

Checks if the map contains the given key.

Returns the value corresponding to the key in the map.

Returns the mutable reference corresponding to the key in the map.

Removes and returns the value corresponding to the key from the map.

Returns the maximum number of key-value pairs the map can hold without reallocating.

Returns the number of key-value pairs in the map.

Returns whether the map is currently empty.

Clears the map of all key-value pairs.

Returns a double-ended iterator visiting all key-value pairs in order of insertion. Iterator element type is (&'a Value, &'a Value).

Returns a double-ended iterator visiting all key-value pairs in order of insertion. Iterator element type is (&'a Value, &'a mut ValuE).

Trait Implementations

impl PartialOrd<Mapping> for Mapping
[src]

impl Default for Mapping
[src]

impl PartialEq<Mapping> for Mapping
[src]

impl From<Mapping> for Value
[src]

Convert map (with string keys) to Value

Examples

use serde_yaml::{Mapping, Value};

let mut m = Mapping::new();
m.insert("Lorem".into(), "ipsum".into());
let x: Value = m.into();

impl Clone for Mapping
[src]

Performs copy-assignment from source. Read more

impl<'a> IntoIterator for &'a Mapping
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

impl<'a> IntoIterator for &'a mut Mapping
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

impl IntoIterator for Mapping
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

impl Extend<(Value, Value)> for Mapping
[src]

impl Eq for Mapping
[src]

impl Debug for Mapping
[src]

impl Hash for Mapping
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a> Index<&'a Value> for Mapping
[src]

The returned type after indexing.

impl<'a> IndexMut<&'a Value> for Mapping
[src]

impl FromIterator<(Value, Value)> for Mapping
[src]

impl Serialize for Mapping
[src]

impl<'de> Deserialize<'de> for Mapping
[src]

Auto Trait Implementations

impl Send for Mapping

impl Sync for Mapping

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T> From for T
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]