Struct gix_config::file::MultiValueMut
source · pub struct MultiValueMut<'borrow, 'lookup, 'event> { /* private fields */ }
Expand description
An intermediate representation of a mutable multivar obtained from a File
.
Implementations§
source§impl<'borrow, 'lookup, 'event> MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> MultiValueMut<'borrow, 'lookup, 'event>
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the multivar does not have any values. This might occur if the value was deleted but wasn’t yet set with a new value.
sourcepub fn set_string_at(&mut self, index: usize, value: impl AsRef<str>)
pub fn set_string_at(&mut self, index: usize, value: impl AsRef<str>)
sourcepub fn set_values<'a, Iter, Item>(&mut self, values: Iter)
pub fn set_values<'a, Iter, Item>(&mut self, values: Iter)
Sets all values to the provided ones. Note that this follows zip
logic: if the number of values in the input is less than the number of
values currently existing, then only the first n
values are modified.
If more values are provided than there currently are, then the
remaining values are ignored.
sourcepub fn set_all<'a>(&mut self, input: impl Into<&'a BStr>)
pub fn set_all<'a>(&mut self, input: impl Into<&'a BStr>)
Sets all values in this multivar to the provided one without owning the provided input.
sourcepub fn delete(&mut self, index: usize)
pub fn delete(&mut self, index: usize)
Removes the value at the given index. Does nothing when called multiple times in succession.
§Safety
This will panic if the index is out of range.
sourcepub fn delete_all(&mut self)
pub fn delete_all(&mut self)
Removes all values. Does nothing when called multiple times in succession.
Trait Implementations§
source§impl<'borrow, 'lookup, 'event> Debug for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Debug for MultiValueMut<'borrow, 'lookup, 'event>
source§impl<'borrow, 'lookup, 'event> PartialEq for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> PartialEq for MultiValueMut<'borrow, 'lookup, 'event>
source§fn eq(&self, other: &MultiValueMut<'borrow, 'lookup, 'event>) -> bool
fn eq(&self, other: &MultiValueMut<'borrow, 'lookup, 'event>) -> bool
self
and other
values to be equal, and is used
by ==
.