pub struct TextSegment {
pub text: String,
pub content: Vec<InlineNode>,
pub mwid: String,
pub section: String,
pub section_level: u8,
}Expand description
A single paragraph-level text segment extracted from a Wikipedia article.
Each segment corresponds to a <p> block in the HTML. It captures the plain
text, the inline content structure, the MediaWiki paragraph ID, the section
heading path, and the heading depth.
Fields§
§text: StringThe extracted plain text of this segment (inline markup stripped).
content: Vec<InlineNode>The inline content nodes, preserving bold/italic/link structure.
mwid: StringThe id attribute of the enclosing <p> element, if present.
section: StringThe section heading path, e.g. "History - Early life".
section_level: u8The heading level of the current section (1–6). 0 if before any heading.
Trait Implementations§
Source§impl Clone for TextSegment
impl Clone for TextSegment
Source§fn clone(&self) -> TextSegment
fn clone(&self) -> TextSegment
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 TextSegment
impl Debug for TextSegment
Auto Trait Implementations§
impl Freeze for TextSegment
impl RefUnwindSafe for TextSegment
impl Send for TextSegment
impl Sync for TextSegment
impl Unpin for TextSegment
impl UnsafeUnpin for TextSegment
impl UnwindSafe for TextSegment
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