pub struct TextWithLineBreaks {
pub text: String,
pub line_breaks: Vec<LineBreakInfo>,
pub nbsp_positions: Vec<usize>,
}Available on crate feature
analysis only.Expand description
Enhanced text with line break preservation
Fields§
§text: StringPlain text with line breaks converted to newlines
line_breaks: Vec<LineBreakInfo>Information about each line break’s type and position
nbsp_positions: Vec<usize>Non-breaking space positions
Implementations§
Source§impl TextWithLineBreaks
impl TextWithLineBreaks
Sourcepub fn from_text(text: &str, drawing_mode: bool) -> Self
pub fn from_text(text: &str, drawing_mode: bool) -> Self
Process text preserving line break types
Sourcepub fn get_break_type_at(&self, position: usize) -> Option<LineBreakType>
pub fn get_break_type_at(&self, position: usize) -> Option<LineBreakType>
Get the type of line break at a given position
Sourcepub fn is_nbsp_at(&self, position: usize) -> bool
pub fn is_nbsp_at(&self, position: usize) -> bool
Check if a position has a non-breaking space
Trait Implementations§
Source§impl Clone for TextWithLineBreaks
impl Clone for TextWithLineBreaks
Source§fn clone(&self) -> TextWithLineBreaks
fn clone(&self) -> TextWithLineBreaks
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextWithLineBreaks
impl RefUnwindSafe for TextWithLineBreaks
impl Send for TextWithLineBreaks
impl Sync for TextWithLineBreaks
impl Unpin for TextWithLineBreaks
impl UnsafeUnpin for TextWithLineBreaks
impl UnwindSafe for TextWithLineBreaks
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