pub enum CodepointsError {
InvalidUtf8Codepoint,
}
Expand description
Error returned when failing to construct a Codepoints
iterator/
This error is returned from String::codepoints
. See its documentation
for more detail.
This error corresponds to the Ruby ArgumentError
Exception class.
When the std feature of spinoso-string
is enabled, this struct
implements std::error::Error
.
Variants§
InvalidUtf8Codepoint
Error returned when calling String::codepoints
on a String
with
UTF-8 encoding which is not a valid UTF-8 byte string.
Implementations§
Source§impl CodepointsError
impl CodepointsError
pub const EXCEPTION_TYPE: &'static str = "ArgumentError"
Sourcepub const fn invalid_utf8_codepoint() -> Self
pub const fn invalid_utf8_codepoint() -> Self
Create a new invalid UTF-8 codepoint CodepointsError
.
§Examples
use spinoso_string::CodepointsError;
const ERR: CodepointsError = CodepointsError::invalid_utf8_codepoint();
assert_eq!(ERR.message(), "invalid byte sequence in UTF-8");
Trait Implementations§
Source§impl Clone for CodepointsError
impl Clone for CodepointsError
Source§fn clone(&self) -> CodepointsError
fn clone(&self) -> CodepointsError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CodepointsError
impl Debug for CodepointsError
Source§impl Display for CodepointsError
impl Display for CodepointsError
Source§impl Error for CodepointsError
impl Error for CodepointsError
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 Hash for CodepointsError
impl Hash for CodepointsError
Source§impl Ord for CodepointsError
impl Ord for CodepointsError
Source§fn cmp(&self, other: &CodepointsError) -> Ordering
fn cmp(&self, other: &CodepointsError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CodepointsError
impl PartialEq for CodepointsError
Source§impl PartialOrd for CodepointsError
impl PartialOrd for CodepointsError
impl Copy for CodepointsError
impl Eq for CodepointsError
impl StructuralPartialEq for CodepointsError
Auto Trait Implementations§
impl Freeze for CodepointsError
impl RefUnwindSafe for CodepointsError
impl Send for CodepointsError
impl Sync for CodepointsError
impl Unpin for CodepointsError
impl UnwindSafe for CodepointsError
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