Struct serde_yaml::Mapping[][src]

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 Clone for Mapping
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Mapping
[src]

Formats the value using the given formatter. Read more

impl Default for Mapping
[src]

Returns the "default value" for a type. Read more

impl Eq for Mapping
[src]

impl Hash for Mapping
[src]

Feeds this value into the given [Hasher]. Read more

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

impl PartialEq for Mapping
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for Mapping
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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

The returned type after indexing.

Performs the indexing (container[index]) operation.

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

Performs the mutable indexing (container[index]) operation.

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

Extends a collection with the contents of an iterator. Read more

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

Creates a value from an iterator. 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?

Creates an iterator from a value. Read more

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?

Creates an iterator from a value. Read more

impl IntoIterator for Mapping
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl Serialize for Mapping
[src]

Serialize this value into the given Serde serializer. Read more

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

Deserialize this value from the given Serde deserializer. Read more

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();

Auto Trait Implementations

impl Send for Mapping

impl Sync for Mapping