pub enum AbsoluteColorBase {
HexColor(HexColor),
NamedColorOrTransparent(Ident),
Function(Function),
}
Variants§
Implementations§
Source§impl AbsoluteColorBase
impl AbsoluteColorBase
Sourcepub const fn is_hex_color(&self) -> bool
pub const fn is_hex_color(&self) -> bool
Returns true
if self
is of variant HexColor
.
Sourcepub fn as_hex_color(&self) -> Option<&HexColor>
pub fn as_hex_color(&self) -> Option<&HexColor>
Returns Some
if self
is a reference of variant HexColor
, and None
otherwise.
Sourcepub fn as_mut_hex_color(&mut self) -> Option<&mut HexColor>
pub fn as_mut_hex_color(&mut self) -> Option<&mut HexColor>
Returns Some
if self
is a mutable reference of variant HexColor
, and None
otherwise.
Sourcepub fn expect_hex_color(self) -> HexColorwhere
Self: Debug,
pub fn expect_hex_color(self) -> HexColorwhere
Self: Debug,
Sourcepub fn hex_color(self) -> Option<HexColor>
pub fn hex_color(self) -> Option<HexColor>
Returns Some
if self
is of variant HexColor
, and None
otherwise.
Sourcepub const fn is_named_color_or_transparent(&self) -> bool
pub const fn is_named_color_or_transparent(&self) -> bool
Returns true
if self
is of variant NamedColorOrTransparent
.
Sourcepub fn as_named_color_or_transparent(&self) -> Option<&Ident>
pub fn as_named_color_or_transparent(&self) -> Option<&Ident>
Returns Some
if self
is a reference of variant NamedColorOrTransparent
, and None
otherwise.
Sourcepub fn as_mut_named_color_or_transparent(&mut self) -> Option<&mut Ident>
pub fn as_mut_named_color_or_transparent(&mut self) -> Option<&mut Ident>
Returns Some
if self
is a mutable reference of variant NamedColorOrTransparent
, and None
otherwise.
Sourcepub fn expect_named_color_or_transparent(self) -> Identwhere
Self: Debug,
pub fn expect_named_color_or_transparent(self) -> Identwhere
Self: Debug,
Unwraps the value, yielding the content of NamedColorOrTransparent
.
§Panics
Panics if the value is not NamedColorOrTransparent
, with a panic message including the content of self
.
Sourcepub fn named_color_or_transparent(self) -> Option<Ident>
pub fn named_color_or_transparent(self) -> Option<Ident>
Returns Some
if self
is of variant NamedColorOrTransparent
, and None
otherwise.
Sourcepub const fn is_function(&self) -> bool
pub const fn is_function(&self) -> bool
Returns true
if self
is of variant Function
.
Sourcepub fn as_function(&self) -> Option<&Function>
pub fn as_function(&self) -> Option<&Function>
Returns Some
if self
is a reference of variant Function
, and None
otherwise.
Sourcepub fn as_mut_function(&mut self) -> Option<&mut Function>
pub fn as_mut_function(&mut self) -> Option<&mut Function>
Returns Some
if self
is a mutable reference of variant Function
, and None
otherwise.
Sourcepub fn expect_function(self) -> Functionwhere
Self: Debug,
pub fn expect_function(self) -> Functionwhere
Self: Debug,
Trait Implementations§
Source§impl Clone for AbsoluteColorBase
impl Clone for AbsoluteColorBase
Source§fn clone(&self) -> AbsoluteColorBase
fn clone(&self) -> AbsoluteColorBase
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AbsoluteColorBase
impl Debug for AbsoluteColorBase
Source§impl EqIgnoreSpan for AbsoluteColorBase
impl EqIgnoreSpan for AbsoluteColorBase
fn eq_ignore_span(&self, other: &Self) -> bool
Source§impl From<AbsoluteColorBase> for Color
impl From<AbsoluteColorBase> for Color
Source§fn from(v: AbsoluteColorBase) -> Self
fn from(v: AbsoluteColorBase) -> Self
Source§impl From<Function> for AbsoluteColorBase
impl From<Function> for AbsoluteColorBase
Source§impl From<HexColor> for AbsoluteColorBase
impl From<HexColor> for AbsoluteColorBase
Source§impl From<Ident> for AbsoluteColorBase
impl From<Ident> for AbsoluteColorBase
Source§impl Hash for AbsoluteColorBase
impl Hash for AbsoluteColorBase
Source§impl PartialEq for AbsoluteColorBase
impl PartialEq for AbsoluteColorBase
Source§impl Spanned for AbsoluteColorBase
impl Spanned for AbsoluteColorBase
impl Eq for AbsoluteColorBase
impl StructuralPartialEq for AbsoluteColorBase
Auto Trait Implementations§
impl Freeze for AbsoluteColorBase
impl RefUnwindSafe for AbsoluteColorBase
impl Send for AbsoluteColorBase
impl Sync for AbsoluteColorBase
impl Unpin for AbsoluteColorBase
impl UnwindSafe for AbsoluteColorBase
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more