#[non_exhaustive]pub enum ParseColorError {
Empty,
InvalidLength {
length: usize,
},
InvalidDigit {
index: usize,
},
InvalidFunction,
OutOfRange,
UnknownName,
}Expand description
Why a string could not be parsed as a color.
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.
Empty
The string is empty or only whitespace.
InvalidLength
A # color that does not have 3 or 6 hexadecimal digits.
InvalidDigit
A character that is not a hexadecimal digit.
InvalidFunction
An rgb(...) that does not hold exactly three whole numbers.
OutOfRange
A channel above 255 in rgb(...).
UnknownName
Neither a #hex color, an rgb(...), nor a known color name.
Trait Implementations§
Source§impl Clone for ParseColorError
impl Clone for ParseColorError
Source§impl Debug for ParseColorError
impl Debug for ParseColorError
Source§impl Display for ParseColorError
impl Display for ParseColorError
impl Eq for ParseColorError
Source§impl Error for ParseColorError
impl Error for ParseColorError
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 ParseColorError
impl PartialEq for ParseColorError
impl StructuralPartialEq for ParseColorError
Auto Trait Implementations§
impl Freeze for ParseColorError
impl RefUnwindSafe for ParseColorError
impl Send for ParseColorError
impl Sync for ParseColorError
impl Unpin for ParseColorError
impl UnsafeUnpin for ParseColorError
impl UnwindSafe for ParseColorError
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