pub struct GrammarError {
pub message: String,
pub offset: usize,
pub length: usize,
pub replacements: Vec<String>,
pub rule_id: String,
}Expand description
Represents a single grammar or spelling error returned by LanguageTool.
This struct maps directly from the LanguageTool API response and is used internally to track error location, message, and suggested replacements.
Fields§
§message: StringHuman-readable description of the error.
offset: usizeByte offset of the error within the plain text (excluding markup segments).
length: usizeLength of the problematic text in bytes.
replacements: Vec<String>Suggested replacement strings, ordered by preference.
rule_id: StringLanguageTool rule identifier that triggered this error.
Trait Implementations§
Source§impl Clone for GrammarError
impl Clone for GrammarError
Source§fn clone(&self) -> GrammarError
fn clone(&self) -> GrammarError
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 moreSource§impl Debug for GrammarError
impl Debug for GrammarError
Source§impl PartialEq for GrammarError
impl PartialEq for GrammarError
Source§fn eq(&self, other: &GrammarError) -> bool
fn eq(&self, other: &GrammarError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GrammarError
Auto Trait Implementations§
impl Freeze for GrammarError
impl RefUnwindSafe for GrammarError
impl Send for GrammarError
impl Sync for GrammarError
impl Unpin for GrammarError
impl UnsafeUnpin for GrammarError
impl UnwindSafe for GrammarError
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