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<Header<'a>> for Header<'a>
 
impl<'a> PartialEq<Header<'a>> for Header<'a>
source§impl<'a> PartialOrd<Header<'a>> for Header<'a>
 
impl<'a> PartialOrd<Header<'a>> 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§
§impl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
 
impl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Pointable for T
 
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
    T: Display,
 
impl<T> ToCompactString for Twhere
    T: Display,
§fn to_compact_string(&self) -> CompactString
 
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more