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> PartialOrd for Header<'a>
impl<'a> PartialOrd for Header<'a>
impl<'a> Eq for Header<'a>
impl<'a> StructuralPartialEq for Header<'a>
Auto Trait Implementations§
impl<'a> Freeze for Header<'a>
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