Struct git_config::parser::ParsedSectionHeader [−][src]
pub struct ParsedSectionHeader<'a> {
pub name: SectionHeaderName<'a>,
pub separator: Option<Cow<'a, str>>,
pub subsection_name: Option<Cow<'a, str>>,
}
Expand description
A parsed section header, containing a name and optionally a subsection name.
Note that section headers must be parsed as valid ASCII, and thus all valid
instances must also necessarily be valid UTF-8, which is why we use a
str
instead of [[u8]
].
Fields
name: SectionHeaderName<'a>
The name of the header.
separator: Option<Cow<'a, str>>
The separator used to determine if the section contains a subsection.
This is either a period .
or a string of whitespace. Note that
reconstruction of subsection format is dependent on this value. If this
is all whitespace, then the subsection name needs to be surrounded by
quotes to have perfect reconstruction.
subsection_name: Option<Cow<'a, str>>
The subsection name without quotes if any exist.
Implementations
Generates a byte representation of the value. This should be used when non-UTF-8 sequences are present or a UTF-8 representation can’t be guaranteed.
Coerces into an owned instance. This differs from the standard clone
implementation as calling clone will not copy the borrowed variant,
while this method will. In other words:
Borrow type | .clone() | to_owned() |
---|---|---|
Borrowed | Borrowed | Owned |
Owned | Owned | Owned |
This can be most effectively seen by the differing lifetimes between the
two. This method guarantees a 'static
lifetime, while clone
does
not.
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
Auto Trait Implementations
impl<'a> RefUnwindSafe for ParsedSectionHeader<'a>
impl<'a> Send for ParsedSectionHeader<'a>
impl<'a> Sync for ParsedSectionHeader<'a>
impl<'a> Unpin for ParsedSectionHeader<'a>
impl<'a> UnwindSafe for ParsedSectionHeader<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more