Enum scarlet::color::RGBParseError
source · pub enum RGBParseError {
OutOfRange,
InvalidHexSyntax,
InvalidFuncSyntax,
InvalidX11Name,
}
Expand description
An error type that results from an invalid attempt to convert a string into an RGB color.
Variants§
OutOfRange
This indicates that function syntax was acceptable, but the numbers were out of range, such as
the invalid string "rgb(554, 23, 553)"
.
InvalidHexSyntax
This indicates that the hex string was malformed in some way.
InvalidFuncSyntax
This indicates a syntax error in the string that was supposed to be a valid rgb( function.
InvalidX11Name
This indicated an invalid color name was supplied to the from_color_name()
function.
Trait Implementations§
source§impl Clone for RGBParseError
impl Clone for RGBParseError
source§fn clone(&self) -> RGBParseError
fn clone(&self) -> RGBParseError
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 RGBParseError
impl Debug for RGBParseError
source§impl Display for RGBParseError
impl Display for RGBParseError
source§impl Error for RGBParseError
impl Error for RGBParseError
source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
source§impl From<ParseIntError> for RGBParseError
impl From<ParseIntError> for RGBParseError
source§fn from(_err: ParseIntError) -> RGBParseError
fn from(_err: ParseIntError) -> RGBParseError
Converts to this type from the input type.
source§impl Hash for RGBParseError
impl Hash for RGBParseError
source§impl PartialEq<RGBParseError> for RGBParseError
impl PartialEq<RGBParseError> for RGBParseError
source§fn eq(&self, other: &RGBParseError) -> bool
fn eq(&self, other: &RGBParseError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for RGBParseError
impl Eq for RGBParseError
impl StructuralEq for RGBParseError
impl StructuralPartialEq for RGBParseError
Auto Trait Implementations§
impl RefUnwindSafe for RGBParseError
impl Send for RGBParseError
impl Sync for RGBParseError
impl Unpin for RGBParseError
impl UnwindSafe for RGBParseError
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
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.