Struct git_config::file::MutableMultiValue
source · [−]pub struct MutableMultiValue<'borrow, 'lookup, 'event> { /* private fields */ }
Expand description
Implementations
sourceimpl<'borrow, 'lookup, 'event> MutableMultiValue<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> MutableMultiValue<'borrow, 'lookup, 'event>
sourcepub fn get(&self) -> Result<Vec<Cow<'_, [u8]>>, GitConfigError<'_>>
pub fn get(&self) -> Result<Vec<Cow<'_, [u8]>>, GitConfigError<'_>>
Returns the actual values. This is computed each time this is called.
Errors
Returns an error if the lookup failed.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns if the multivar has any values. This might occur if the value was deleted but not set with a new value.
sourcepub fn set_string(&mut self, index: usize, input: String)
pub fn set_string(&mut self, index: usize, input: String)
sourcepub fn set_values<'a: 'event>(
&mut self,
input: impl Iterator<Item = Cow<'a, [u8]>>
)
pub fn set_values<'a: 'event>(
&mut self,
input: impl Iterator<Item = Cow<'a, [u8]>>
)
Sets all values to the provided values. 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_str_all(&mut self, input: &str)
pub fn set_str_all(&mut self, input: &str)
Sets all values in this multivar to the provided one by copying the input for all values.
sourcepub fn set_owned_values_all(&mut self, input: &[u8])
pub fn set_owned_values_all(&mut self, input: &[u8])
Sets all values in this multivar to the provided one by copying the input bytes for all values.
sourcepub fn set_values_all<'a: 'event>(&mut self, input: &'a [u8])
pub fn set_values_all<'a: 'event>(&mut self, input: &'a [u8])
Sets all values in this multivar to the provided one without owning the
provided input. Note that this requires input
to last longer than
GitConfig
. Consider using Self::set_owned_values_all
or
Self::set_str_all
unless you have a strict performance or memory
need for a more ergonomic interface.
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 MutableMultiValue<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Debug for MutableMultiValue<'borrow, 'lookup, 'event>
sourceimpl<'borrow, 'lookup, 'event> PartialEq<MutableMultiValue<'borrow, 'lookup, 'event>> for MutableMultiValue<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> PartialEq<MutableMultiValue<'borrow, 'lookup, 'event>> for MutableMultiValue<'borrow, 'lookup, 'event>
sourcefn eq(&self, other: &MutableMultiValue<'borrow, 'lookup, 'event>) -> bool
fn eq(&self, other: &MutableMultiValue<'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: &MutableMultiValue<'borrow, 'lookup, 'event>) -> bool
fn ne(&self, other: &MutableMultiValue<'borrow, 'lookup, 'event>) -> bool
This method tests for !=
.
impl<'borrow, 'lookup, 'event> Eq for MutableMultiValue<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> StructuralEq for MutableMultiValue<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> StructuralPartialEq for MutableMultiValue<'borrow, 'lookup, 'event>
Auto Trait Implementations
impl<'borrow, 'lookup, 'event> RefUnwindSafe for MutableMultiValue<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Send for MutableMultiValue<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Sync for MutableMultiValue<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Unpin for MutableMultiValue<'borrow, 'lookup, 'event> where
'event: 'borrow,
impl<'borrow, 'lookup, 'event> !UnwindSafe for MutableMultiValue<'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