pub struct HeadingComment {
pub header: Span,
pub content: Span,
}
Expand description
A parsed heading comment.
Fields§
§header: Span
The header part of the heading comment (the text of the header)
content: Span
The content part of the heading comment (descriptive text regarding the header)
Implementations§
Source§impl HeadingComment
impl HeadingComment
Sourcepub fn parse(buf: &[u8], lvl: HeadingLevel, sp: Span) -> Option<Self>
pub fn parse(buf: &[u8], lvl: HeadingLevel, sp: Span) -> Option<Self>
Parses a heading comment at the given span in a segment buffer,
with the specified heading level and span. Returns None
if this is not a heading comment
or it is malformed.
Sourcepub fn parse_mathbox_header(&self, buf: &[u8]) -> Option<Span>
pub fn parse_mathbox_header(&self, buf: &[u8]) -> Option<Span>
Parses a mathbox heading comment, returning the span of the author name.
Trait Implementations§
Source§impl Clone for HeadingComment
impl Clone for HeadingComment
Source§fn clone(&self) -> HeadingComment
fn clone(&self) -> HeadingComment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HeadingComment
impl Debug for HeadingComment
impl Copy for HeadingComment
Auto Trait Implementations§
impl Freeze for HeadingComment
impl RefUnwindSafe for HeadingComment
impl Send for HeadingComment
impl Sync for HeadingComment
impl Unpin for HeadingComment
impl UnwindSafe for HeadingComment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more