Struct git_repository::config::file::ValueMut
source · pub struct ValueMut<'borrow, 'lookup, 'event> { /* private fields */ }
Expand description
An intermediate representation of a mutable value obtained from a File
.
Implementations
sourceimpl<'borrow, 'lookup, 'event> ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> ValueMut<'borrow, 'lookup, 'event>
sourcepub fn get(&self) -> Result<Cow<'_, BStr>, Error>
pub fn get(&self) -> Result<Cow<'_, BStr>, Error>
Returns the actual value. This is computed each time this is called requiring an allocation for multi-line values.
sourcepub fn set_string(&mut self, input: impl AsRef<str>)
pub fn set_string(&mut self, input: impl AsRef<str>)
Update the value to the provided one. This modifies the value such that the Value event(s) are replaced with a single new event containing the new value.
sourcepub fn set<'a>(&mut self, input: impl Into<&'a BStr>)
pub fn set<'a>(&mut self, input: impl Into<&'a BStr>)
Update the value to the provided one. This modifies the value such that the Value event(s) are replaced with a single new event containing the new value.
sourcepub fn delete(&mut self)
pub fn delete(&mut self)
Removes the value. Does nothing when called multiple times in succession.
sourcepub fn into_section_mut(self) -> SectionMut<'borrow, 'event>
pub fn into_section_mut(self) -> SectionMut<'borrow, 'event>
Convert this value into its owning mutable section.
Trait Implementations
sourceimpl<'borrow, 'lookup, 'event> Ord for ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Ord for ValueMut<'borrow, 'lookup, 'event>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'borrow, 'lookup, 'event> PartialEq<ValueMut<'borrow, 'lookup, 'event>> for ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> PartialEq<ValueMut<'borrow, 'lookup, 'event>> for ValueMut<'borrow, 'lookup, 'event>
sourceimpl<'borrow, 'lookup, 'event> PartialOrd<ValueMut<'borrow, 'lookup, 'event>> for ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> PartialOrd<ValueMut<'borrow, 'lookup, 'event>> for ValueMut<'borrow, 'lookup, 'event>
sourcefn partial_cmp(
&self,
other: &ValueMut<'borrow, 'lookup, 'event>
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &ValueMut<'borrow, 'lookup, 'event>
) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'borrow, 'lookup, 'event> Eq for ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> StructuralEq for ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> StructuralPartialEq for ValueMut<'borrow, 'lookup, 'event>
Auto Trait Implementations
impl<'borrow, 'lookup, 'event> RefUnwindSafe for ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Send for ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Sync for ValueMut<'borrow, 'lookup, 'event>
impl<'borrow, 'lookup, 'event> Unpin for ValueMut<'borrow, 'lookup, 'event>where
'event: 'borrow,
impl<'borrow, 'lookup, 'event> !UnwindSafe for ValueMut<'borrow, 'lookup, 'event>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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