#[non_exhaustive]pub enum TextReplacementError {
InvalidNodeRange {
start: usize,
end: usize,
node_count: usize,
},
NonTextNode {
index: usize,
},
ReversedByteRange {
start: usize,
end: usize,
},
ByteRangeOutOfBounds {
end: usize,
text_len: usize,
},
NotCharBoundary {
offset: usize,
},
}Expand description
Error returned when a pass replaces an invalid node or text range.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidNodeRange
The requested range does not select a non-empty slice of nodes.
Fields
NonTextNode
The selected slice includes a node that is not text.
ReversedByteRange
The byte range starts after its end.
ByteRangeOutOfBounds
The byte range extends beyond the coalesced text.
NotCharBoundary
A byte offset splits a UTF-8 code point.
Trait Implementations§
Source§impl Clone for TextReplacementError
impl Clone for TextReplacementError
Source§impl Debug for TextReplacementError
impl Debug for TextReplacementError
Source§impl Display for TextReplacementError
impl Display for TextReplacementError
impl Eq for TextReplacementError
Source§impl Error for TextReplacementError
impl Error for TextReplacementError
1.30.0 · 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()
Source§impl PartialEq for TextReplacementError
impl PartialEq for TextReplacementError
impl StructuralPartialEq for TextReplacementError
Auto Trait Implementations§
impl Forget for TextReplacementError
impl Freeze for TextReplacementError
impl Move for TextReplacementError
impl RefUnwindSafe for TextReplacementError
impl Send for TextReplacementError
impl Sync for TextReplacementError
impl Unpin for TextReplacementError
impl UnsafeUnpin for TextReplacementError
impl UnwindSafe for TextReplacementError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more