pub struct DocBlock {
pub kind: DocBlockKind,
pub text: String,
pub start: usize,
pub end: usize,
pub heading_path: Vec<String>,
pub level: Option<usize>,
}Expand description
One parsed span of a document, carrying its byte offsets and the heading path in effect where it appears.
Fields§
§kind: DocBlockKindWhether this block is a heading or a paragraph.
text: StringThe block’s text: the heading title for headings, the joined paragraph lines for paragraphs.
start: usizeInclusive start byte offset of the block within the source text.
end: usizeExclusive end byte offset of the block within the source text.
heading_path: Vec<String>The chain of enclosing heading titles, outermost first.
level: Option<usize>The heading depth (1-6) for headings; None for paragraphs.
Trait Implementations§
impl Eq for DocBlock
impl StructuralPartialEq for DocBlock
Auto Trait Implementations§
impl Freeze for DocBlock
impl RefUnwindSafe for DocBlock
impl Send for DocBlock
impl Sync for DocBlock
impl Unpin for DocBlock
impl UnsafeUnpin for DocBlock
impl UnwindSafe for DocBlock
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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