Struct ini::Properties
source · [−]pub struct Properties { /* private fields */ }
Expand description
Properties type (key-value pairs)
Implementations
sourceimpl 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
sourceimpl Clone for Properties
impl Clone for Properties
sourcefn clone(&self) -> Properties
fn clone(&self) -> Properties
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Properties
impl Debug for Properties
sourceimpl Default for Properties
impl Default for Properties
sourcefn default() -> Properties
fn default() -> Properties
Returns the “default value” for a type. Read more
sourceimpl<S: AsRef<str>> Index<S> for Properties
impl<S: AsRef<str>> Index<S> for Properties
sourceimpl PartialEq<Properties> for Properties
impl PartialEq<Properties> for Properties
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &Properties) -> bool
fn ne(&self, other: &Properties) -> bool
This method tests for !=
.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more