Struct git_config::file::MutableSection [−][src]
pub struct MutableSection<'borrow, 'event> { /* fields omitted */ }
Expand description
A opaque type that represents a mutable reference to a section.
Implementations
Adds an entry to the end of this section.
Removes all events until a key value pair is removed. This will also remove the whitespace preceding the key value pair, if any is found.
Sets the last key value pair if it exists, or adds the new value. Returns the previous value if it replaced a value, or None if it adds the value.
Removes the latest value by key and returns it, if it exists.
Adds a new line event. Note that you don’t need to call this unless you’ve disabled implicit newlines.
Enables or disables automatically adding newline events after adding a value. This is enabled by default.
Sets the number of spaces before the start of a key value. By default, this is set to two. Set to 0 to disable adding whitespace before a key value.
Returns the number of whitespace this section will insert before the beginning of a key.
Methods from Deref<Target = SectionBody<'event>>
Retrieves the last matching value in a section with the given key. Returns None if the key was not found.
Retrieves the last matching value in a section with the given key, and attempts to convert the value into the provided type.
Errors
Returns an error if the key was not found, or if the conversion failed.
Retrieves all values that have the provided key name. This may return an empty vec, which implies there was values with the provided key.
Retrieves all values that have the provided key name. This may return an empty vec, which implies there was values with the provided key.
Errors
Returns an error if the conversion failed.
Returns an iterator visiting all keys in order.
Checks if the section contains the provided key.
Trait Implementations
type Target = SectionBody<'event>
type Target = SectionBody<'event>
The resulting type after dereferencing.
impl<'borrow, 'event> PartialEq<MutableSection<'borrow, 'event>> for MutableSection<'borrow, 'event>
impl<'borrow, 'event> PartialEq<MutableSection<'borrow, 'event>> for MutableSection<'borrow, 'event>
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<'borrow, 'event> PartialOrd<MutableSection<'borrow, 'event>> for MutableSection<'borrow, 'event>
impl<'borrow, 'event> PartialOrd<MutableSection<'borrow, 'event>> for MutableSection<'borrow, 'event>
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more