pub enum EditorError {
OutOfBounds {
offset: usize,
len: usize,
},
InvalidRow {
row: usize,
total_lines: usize,
},
InvalidRange {
range: Range<usize>,
len: usize,
},
InvalidCharBoundary {
offset: usize,
},
EmptySearchPattern,
InvalidRegex {
pattern: String,
message: String,
},
Io(Error),
}Expand description
Error type for editor buffer validation, range operations, and file I/O.
Variants§
OutOfBounds
The specified byte offset is out of document bounds.
Fields
InvalidRow
The specified row index is out of document line bounds.
Fields
InvalidRange
The range is invalid because start offset exceeds end offset or document bounds.
Fields
InvalidCharBoundary
The byte offset does not land on a valid UTF-8 character boundary.
EmptySearchPattern
A search was attempted with an empty pattern.
InvalidRegex
A regex search pattern failed to compile.
Fields
Io(Error)
An I/O error occurred during file reading or writing.
Trait Implementations§
Source§impl Debug for EditorError
impl Debug for EditorError
Source§impl Display for EditorError
impl Display for EditorError
Source§impl Error for EditorError
impl Error for EditorError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for EditorError
impl !UnwindSafe for EditorError
impl Freeze for EditorError
impl Send for EditorError
impl Sync for EditorError
impl Unpin for EditorError
impl UnsafeUnpin for EditorError
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