#[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.