pub struct TextSegment {
pub text: String,
pub is_markup: bool,
pub offset: usize,
pub unit_id: usize,
}Expand description
A segment of text extracted from source code, with metadata for LanguageTool processing.
Segments are either plain prose (checked by LanguageTool) or markup (skipped during
checking but preserved for offset mapping). The offset field tracks the segment’s
position in the original source file.
Fields§
§text: StringThe text content of this segment.
is_markup: boolWhen true, LanguageTool ignores this segment during checking.
Used for code, HTML tags, markdown delimiters, etc.
Serialized as "markup" for LanguageTool API compatibility.
offset: usizeByte offset of this segment in the original source content.
Skipped during serialization (#[serde(skip)]) as it is internal-only.
unit_id: usizeLanguageTool check unit identifier for grouping related prose segments.
Skipped during serialization (#[serde(skip)]) as it is internal-only.
Trait Implementations§
Source§impl Clone for TextSegment
impl Clone for TextSegment
Source§fn clone(&self) -> TextSegment
fn clone(&self) -> TextSegment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextSegment
impl Debug for TextSegment
Source§impl PartialEq for TextSegment
impl PartialEq for TextSegment
Source§fn eq(&self, other: &TextSegment) -> bool
fn eq(&self, other: &TextSegment) -> bool
self and other values to be equal, and is used by ==.