Struct gix_config::parse::section::Header
source · pub struct Header<'a> { /* private fields */ }
Expand description
A parsed section header, containing a name and optionally a subsection name.
Implementations§
source§impl Header<'_>
impl Header<'_>
sourcepub fn is_legacy(&self) -> bool
pub fn is_legacy(&self) -> bool
Return true if this is a header like [legacy.subsection]
, or false otherwise.
sourcepub fn subsection_name(&self) -> Option<&BStr>
pub fn subsection_name(&self) -> Option<&BStr>
Return the subsection name, if present, i.e. “origin” in [remote "origin"]
.
It is parsed without quotes, and with escapes folded
into their resulting characters.
Thus during serialization, escapes and quotes must be re-added.
This makes it possible to use Event
data for lookups directly.
sourcepub fn to_bstring(&self) -> BString
pub fn to_bstring(&self) -> BString
Serialize this type into a BString
for convenience.
Note that to_string()
can also be used, but might not be lossless.
Trait Implementations§
source§impl<'a> Ord for Header<'a>
impl<'a> Ord for Header<'a>
1.21.0 · source§fn 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
source§impl<'a> PartialEq for Header<'a>
impl<'a> PartialEq for Header<'a>
source§impl<'a> PartialOrd for Header<'a>
impl<'a> PartialOrd for Header<'a>
1.0.0 · source§fn 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<'a> Eq for Header<'a>
impl<'a> StructuralEq for Header<'a>
impl<'a> StructuralPartialEq for Header<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Header<'a>
impl<'a> Send for Header<'a>
impl<'a> Sync for Header<'a>
impl<'a> Unpin for Header<'a>
impl<'a> UnwindSafe for Header<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more