pub struct Mapping { /* private fields */ }Expand description
Implementations§
Source§impl Mapping
impl Mapping
Sourcepub fn get_mut(&mut self, key: &str) -> Option<&mut Value>
pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>
Looks up a mutable value by string key.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns true if the mapping contains the given string key.
Sourcepub fn insert(&mut self, key: impl Into<String>, value: Value) -> Option<Value>
pub fn insert(&mut self, key: impl Into<String>, value: Value) -> Option<Value>
Inserts (or, if the string key already exists, replaces) a value, preserving the position of an existing key. Returns the previous value.
Sourcepub fn remove(&mut self, key: &str) -> Option<Value>
pub fn remove(&mut self, key: &str) -> Option<Value>
Removes a value by string key, preserving order of the rest.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&Value, &Value)>
pub fn iter(&self) -> impl Iterator<Item = (&Value, &Value)>
Iterates over (key, value) pairs in order.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = (&mut Value, &mut Value)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&mut Value, &mut Value)>
Iterates over mutable (key, value) pairs in order.
Trait Implementations§
Source§impl<'a> Extend<(&'a str, Value)> for Mapping
impl<'a> Extend<(&'a str, Value)> for Mapping
Source§fn extend<T: IntoIterator<Item = (&'a str, Value)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (&'a str, Value)>>(&mut self, iter: T)
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 Extend<(String, Value)> for Mapping
impl Extend<(String, Value)> for Mapping
Source§fn extend<T: IntoIterator<Item = (String, Value)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (String, Value)>>(&mut self, iter: T)
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 Extend<(Value, Value)> for Mapping
impl Extend<(Value, Value)> for Mapping
Source§fn extend<T: IntoIterator<Item = (Value, Value)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (Value, Value)>>(&mut self, iter: T)
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 From<Frontmatter> for Mapping
impl From<Frontmatter> for Mapping
Source§fn from(fm: Frontmatter) -> Self
fn from(fm: Frontmatter) -> Self
Converts to this type from the input type.
Source§impl From<Mapping> for Frontmatter
impl From<Mapping> for Frontmatter
Source§impl IntoIterator for Mapping
impl IntoIterator for Mapping
Source§impl<'a> IntoIterator for &'a Mapping
impl<'a> IntoIterator for &'a Mapping
Source§impl<'a> IntoIterator for &'a mut Mapping
impl<'a> IntoIterator for &'a mut Mapping
impl StructuralPartialEq for Mapping
Auto Trait Implementations§
impl Freeze for Mapping
impl RefUnwindSafe for Mapping
impl Send for Mapping
impl Sync for Mapping
impl Unpin for Mapping
impl UnsafeUnpin for Mapping
impl UnwindSafe for Mapping
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more