Struct ini::Properties
source · pub struct Properties { /* private fields */ }
Expand description
Properties type (key-value pairs)
Implementations§
source§impl Properties
impl Properties
sourcepub fn new() -> Properties
pub fn new() -> Properties
Create an instance
sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = (&str, &str)>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = (&str, &str)>
Get an iterator of the properties
sourcepub fn contains_key<S: AsRef<str>>(&self, s: S) -> bool
pub fn contains_key<S: AsRef<str>>(&self, s: S) -> bool
Return true if property exist
sourcepub fn insert<K, V>(&mut self, k: K, v: V)where
K: Into<String>,
V: Into<String>,
pub fn insert<K, V>(&mut self, k: K, v: V)where K: Into<String>, V: Into<String>,
Insert (key, value) pair by replace
sourcepub fn append<K, V>(&mut self, k: K, v: V)where
K: Into<String>,
V: Into<String>,
pub fn append<K, V>(&mut self, k: K, v: V)where K: Into<String>, V: Into<String>,
Append key with (key, value) pair
sourcepub fn get<S: AsRef<str>>(&self, s: S) -> Option<&str>
pub fn get<S: AsRef<str>>(&self, s: S) -> Option<&str>
Get the first value associate with the key
sourcepub fn get_all<S: AsRef<str>>(
&self,
s: S
) -> impl DoubleEndedIterator<Item = &str>
pub fn get_all<S: AsRef<str>>( &self, s: S ) -> impl DoubleEndedIterator<Item = &str>
Get all values associate with the key
sourcepub fn remove<S: AsRef<str>>(&mut self, s: S) -> Option<String>
pub fn remove<S: AsRef<str>>(&mut self, s: S) -> Option<String>
Remove the property with the first value of the key
sourcepub fn remove_all<'a, S: AsRef<str>>(
&'a mut self,
s: S
) -> impl DoubleEndedIterator<Item = String> + 'a
pub fn remove_all<'a, S: AsRef<str>>( &'a mut self, s: S ) -> impl DoubleEndedIterator<Item = String> + 'a
Remove the property with all values with the same key
Trait Implementations§
source§impl Clone for Properties
impl Clone for Properties
source§fn clone(&self) -> Properties
fn clone(&self) -> Properties
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Properties
impl Debug for Properties
source§impl Default for Properties
impl Default for Properties
source§fn default() -> Properties
fn default() -> Properties
Returns the “default value” for a type. Read more
source§impl PartialEq<Properties> for Properties
impl PartialEq<Properties> for Properties
source§fn eq(&self, other: &Properties) -> bool
fn eq(&self, other: &Properties) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for Properties
Auto Trait Implementations§
impl RefUnwindSafe for Properties
impl Send for Properties
impl Sync for Properties
impl Unpin for Properties
impl UnwindSafe for Properties
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