#[non_exhaustive]pub enum Error {
ByteIndexOutOfBounds(usize, usize),
CharIndexOutOfBounds(usize, usize),
LineIndexOutOfBounds(usize, usize),
Utf16IndexOutOfBounds(usize, usize),
ByteIndexNotCharBoundary(usize),
ByteRangeNotCharBoundary(Option<usize>, Option<usize>),
ByteRangeInvalid(usize, usize),
CharRangeInvalid(usize, usize),
ByteRangeOutOfBounds(Option<usize>, Option<usize>, usize),
CharRangeOutOfBounds(Option<usize>, Option<usize>, usize),
}
Expand description
Ropey’s error type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ByteIndexOutOfBounds(usize, usize)
Indicates that the passed byte index was out of bounds.
Contains the index attempted and the actual length of the
Rope
/RopeSlice
in bytes, in that order.
CharIndexOutOfBounds(usize, usize)
Indicates that the passed char index was out of bounds.
Contains the index attempted and the actual length of the
Rope
/RopeSlice
in chars, in that order.
LineIndexOutOfBounds(usize, usize)
Indicates that the passed line index was out of bounds.
Contains the index attempted and the actual length of the
Rope
/RopeSlice
in lines, in that order.
Utf16IndexOutOfBounds(usize, usize)
Indicates that the passed utf16 code-unit index was out of bounds.
Contains the index attempted and the actual length of the
Rope
/RopeSlice
in utf16 code units, in that order.
ByteIndexNotCharBoundary(usize)
Indicates that the passed byte index was not a char boundary.
Contains the passed byte index.
ByteRangeNotCharBoundary(Option<usize>, Option<usize>)
Indicates that the passed byte range didn’t line up with char boundaries.
Contains the [start, end) byte indices of the range, in that order.
When either the start or end are None
, that indicates a half-open
range.
ByteRangeInvalid(usize, usize)
Indicates that a reversed byte-index range (end < start) was encountered.
Contains the [start, end) byte indices of the range, in that order.
CharRangeInvalid(usize, usize)
Indicates that a reversed char-index range (end < start) was encountered.
Contains the [start, end) char indices of the range, in that order.
ByteRangeOutOfBounds(Option<usize>, Option<usize>, usize)
Indicates that the passed byte-index range was partially or fully out of bounds.
Contains the [start, end) byte indices of the range and the actual
length of the Rope
/RopeSlice
in bytes, in that order. When
either the start or end are None
, that indicates a half-open range.
CharRangeOutOfBounds(Option<usize>, Option<usize>, usize)
Indicates that the passed char-index range was partially or fully out of bounds.
Contains the [start, end) char indices of the range and the actual
length of the Rope
/RopeSlice
in chars, in that order. When
either the start or end are None
, that indicates a half-open range.
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
source§fn description(&self) -> &str
fn description(&self) -> &str
impl Copy for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)