pub enum Utf8IndexError {
InvalidCharBoundary {
index: usize,
},
IndexOutOfBounds(OutOfBounds),
RangeOutOfBounds(RangeOutOfBounds),
}Expand description
Error type for UTF-8 index and range operations.
Variants§
InvalidCharBoundary
The index does not lie on a UTF-8 character boundary.
IndexOutOfBounds(OutOfBounds)
A single index was outside the visible bounds.
RangeOutOfBounds(RangeOutOfBounds)
A range was reversed, overflowing, or outside the visible bounds.
Trait Implementations§
Source§impl Clone for Utf8IndexError
impl Clone for Utf8IndexError
impl Copy for Utf8IndexError
Source§impl Debug for Utf8IndexError
impl Debug for Utf8IndexError
Source§impl Display for Utf8IndexError
impl Display for Utf8IndexError
impl Eq for Utf8IndexError
Source§impl Error for Utf8IndexError
impl Error for Utf8IndexError
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 From<OutOfBounds> for Utf8IndexError
impl From<OutOfBounds> for Utf8IndexError
Source§fn from(value: OutOfBounds) -> Self
fn from(value: OutOfBounds) -> Self
Converts to this type from the input type.
Source§impl From<RangeOutOfBounds> for Utf8IndexError
impl From<RangeOutOfBounds> for Utf8IndexError
Source§fn from(value: RangeOutOfBounds) -> Self
fn from(value: RangeOutOfBounds) -> Self
Converts to this type from the input type.
Source§impl From<Utf8IndexError> for Utf8EditError
impl From<Utf8IndexError> for Utf8EditError
Source§fn from(value: Utf8IndexError) -> Self
fn from(value: Utf8IndexError) -> Self
Converts to this type from the input type.
Source§impl From<Utf8IndexError> for Error
Available on crate feature std only.
impl From<Utf8IndexError> for Error
Available on crate feature
std only.Source§fn from(value: Utf8IndexError) -> Self
fn from(value: Utf8IndexError) -> Self
Converts to this type from the input type.
Source§impl Hash for Utf8IndexError
impl Hash for Utf8IndexError
Source§impl PartialEq for Utf8IndexError
impl PartialEq for Utf8IndexError
impl StructuralPartialEq for Utf8IndexError
Auto Trait Implementations§
impl Freeze for Utf8IndexError
impl RefUnwindSafe for Utf8IndexError
impl Send for Utf8IndexError
impl Sync for Utf8IndexError
impl Unpin for Utf8IndexError
impl UnsafeUnpin for Utf8IndexError
impl UnwindSafe for Utf8IndexError
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> ToUtf8Bytes for T
impl<T> ToUtf8Bytes for T
Source§fn to_utf8bytes(&self) -> Utf8Bytes<Shared>
fn to_utf8bytes(&self) -> Utf8Bytes<Shared>
Available on crate features
alloc or std only.Source§fn to_compact_utf8bytes(&self) -> Utf8Bytes<Compact>
fn to_compact_utf8bytes(&self) -> Utf8Bytes<Compact>
Available on crate features
alloc or std only.