Struct git_repository::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
sourceimpl<'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) where
Iter: IntoIterator<Item = Item>,
Item: Into<&'a BStr>,
pub fn set_values<'a, Iter, Item>(&mut self, values: Iter) where
Iter: IntoIterator<Item = Item>,
Item: Into<&'a BStr>,
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
sourceimpl<'borrow, 'lookup, 'event> Debug for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Debug for MultiValueMut<'borrow, 'lookup, 'event>
sourceimpl<'borrow, 'lookup, 'event> PartialEq<MultiValueMut<'borrow, 'lookup, 'event>> for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> PartialEq<MultiValueMut<'borrow, 'lookup, 'event>> for MultiValueMut<'borrow, 'lookup, 'event>
sourcefn eq(&self, other: &MultiValueMut<'borrow, 'lookup, 'event>) -> bool
fn eq(&self, other: &MultiValueMut<'borrow, 'lookup, 'event>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MultiValueMut<'borrow, 'lookup, 'event>) -> bool
fn ne(&self, other: &MultiValueMut<'borrow, 'lookup, 'event>) -> bool
This method tests for !=
.
impl<'borrow, 'lookup, 'event> Eq for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> StructuralEq for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> StructuralPartialEq for MultiValueMut<'borrow, 'lookup, 'event>
Auto Trait Implementations
impl<'borrow, 'lookup, 'event> RefUnwindSafe for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Send for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Sync for MultiValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Unpin for MultiValueMut<'borrow, 'lookup, 'event> where
'event: 'borrow,
impl<'borrow, 'lookup, 'event> !UnwindSafe for MultiValueMut<'borrow, 'lookup, 'event>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more