pub enum Error {
Utf8Error(Utf8Error),
IndexOutOfBounds {
index: usize,
len: usize,
},
InvalidRange {
start: usize,
end: usize,
},
InvalidCharBoundary {
index: usize,
},
}Expand description
Compatibility error type for range operations and explicit conversions.
CheetahString::try_substring returns
this type through the crate’s Result alias. UTF-8 text
constructors return Utf8Error directly; Utf8Error can still be wrapped
through From for source-compatible 3.1 error aggregation.
Variants§
Utf8Error(Utf8Error)
UTF-8 validation failed.
IndexOutOfBounds
An index was beyond the string length.
InvalidRange
A range started after its end.
InvalidCharBoundary
An index did not lie on a UTF-8 character boundary.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
Available on crate feature
std only.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()
impl StructuralPartialEq 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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more