Struct git_config::file::MutableValue[][src]

pub struct MutableValue<'borrow, 'lookup, 'event> { /* fields omitted */ }

An intermediate representation of a mutable value obtained from GitConfig.

This holds a mutable reference to the underlying data structure of GitConfig, and thus guarantees through Rust’s borrower checker that multiple mutable references to GitConfig cannot be owned at the same time.

Implementations

impl MutableValue<'_, '_, '_>[src]

pub fn get(&self) -> Result<Cow<'_, [u8]>, GitConfigError<'_>>[src]

Returns the actual value. This is computed each time this is called, so it’s best to reuse this value or own it if an allocation is acceptable.

Errors

Returns an error if the lookup failed.

pub fn set_string(&mut self, input: String)[src]

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.

pub fn set_bytes(&mut self, input: Vec<u8>)[src]

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.

pub fn delete(&mut self)[src]

Removes the value. Does nothing when called multiple times in succession.

Trait Implementations

impl<'borrow, 'lookup, 'event> Debug for MutableValue<'borrow, 'lookup, 'event>[src]

impl<'borrow, 'lookup, 'event> Eq for MutableValue<'borrow, 'lookup, 'event>[src]

impl<'borrow, 'lookup, 'event> Hash for MutableValue<'borrow, 'lookup, 'event>[src]

impl<'borrow, 'lookup, 'event> Ord for MutableValue<'borrow, 'lookup, 'event>[src]

impl<'borrow, 'lookup, 'event> PartialEq<MutableValue<'borrow, 'lookup, 'event>> for MutableValue<'borrow, 'lookup, 'event>[src]

impl<'borrow, 'lookup, 'event> PartialOrd<MutableValue<'borrow, 'lookup, 'event>> for MutableValue<'borrow, 'lookup, 'event>[src]

impl<'borrow, 'lookup, 'event> StructuralEq for MutableValue<'borrow, 'lookup, 'event>[src]

impl<'borrow, 'lookup, 'event> StructuralPartialEq for MutableValue<'borrow, 'lookup, 'event>[src]

Auto Trait Implementations

impl<'borrow, 'lookup, 'event> RefUnwindSafe for MutableValue<'borrow, 'lookup, 'event>

impl<'borrow, 'lookup, 'event> Send for MutableValue<'borrow, 'lookup, 'event>

impl<'borrow, 'lookup, 'event> Sync for MutableValue<'borrow, 'lookup, 'event>

impl<'borrow, 'lookup, 'event> Unpin for MutableValue<'borrow, 'lookup, 'event> where
    'event: 'borrow, 

impl<'borrow, 'lookup, 'event> !UnwindSafe for MutableValue<'borrow, 'lookup, 'event>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.