pub struct HeaderRef<'a> { /* private fields */ }Expand description
A view of a section header whose bytes are owned by the containing File.
Implementations§
Source§impl<'a> HeaderRef<'a>
impl<'a> HeaderRef<'a>
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<&'a BStr>
pub fn subsection_name(&self) -> Option<&'a BStr>
Return the subsection name, if present, i.e. “origin” in [remote "origin"].
Sourcepub fn name(&self) -> &'a BStr
pub fn name(&self) -> &'a BStr
Return the name of the header, like “remote” in [remote "origin"].
Sourcepub fn to_bstring(&self) -> BString
pub fn to_bstring(&self) -> BString
Serialize this header view into a BString for convenience.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for HeaderRef<'a>
impl<'a> RefUnwindSafe for HeaderRef<'a>
impl<'a> Send for HeaderRef<'a>
impl<'a> Sync for HeaderRef<'a>
impl<'a> Unpin for HeaderRef<'a>
impl<'a> UnsafeUnpin for HeaderRef<'a>
impl<'a> UnwindSafe for HeaderRef<'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