Struct Flags
pub struct Flags {
missing: Missing,
name: u8,
}Expand description
Flags indicating DynamicColor state.
The “missing” flags indicate whether a specific color component is missing (either the three color channels or the alpha channel).
The “named” flag represents whether the dynamic color was parsed from one of the named colors in CSS Color Module Level 4 § 6.1 or named color space functions in CSS Color Module Level 4 § 4.1.
The latter is primarily useful for serializing to a CSS-compliant string format.
Fields§
§missing: Missing§name: u8Implementations§
§impl Flags
impl Flags
pub const fn from_missing(missing: Missing) -> Flags
pub const fn from_missing(missing: Missing) -> Flags
Construct flags with the given missing components.
pub fn set_missing(&mut self, missing: Missing)
pub fn set_missing(&mut self, missing: Missing)
Set the missing components.
pub const fn named(self) -> bool
pub const fn named(self) -> bool
Returns true if the flags indicate the color was generated from a named color or named
color space function.
pub const fn color_name(self) -> Option<&'static str>
pub const fn color_name(self) -> Option<&'static str>
If the color was constructed from a named color, returns that name.
See also parse_color.
pub fn discard_name(&mut self)
pub fn discard_name(&mut self)
Discard the color name or color space name from the flags.
Trait Implementations§
impl Copy for Flags
impl Eq for Flags
impl StructuralPartialEq for Flags
Auto Trait Implementations§
impl Freeze for Flags
impl RefUnwindSafe for Flags
impl Send for Flags
impl Sync for Flags
impl Unpin for Flags
impl UnwindSafe for Flags
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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