Struct gooey::core::styles::Style [−]
pub struct Style { /* fields omitted */ }
Expand description
A set of style components.
Implementations
impl Style
impl Style
pub fn push<T>(&mut self, component: T) where
T: StyleComponent + Clone,
pub fn push<T>(&mut self, component: T) where
T: StyleComponent + Clone,
Adds a component to this style. Any existing values of the same type will be replaced.
pub fn with<T>(self, component: T) -> Style where
T: StyleComponent + Clone,
pub fn with<T>(self, component: T) -> Style where
T: StyleComponent + Clone,
Adds a component to the style and returns it. Any existing values of the same type will be replaced.
pub fn get<T>(&self) -> Option<&T> where
T: StyleComponent,
pub fn get<T>(&self) -> Option<&T> where
T: StyleComponent,
Returns the style component of type T
, if present.
pub fn get_with_fallback<T>(&self) -> Option<&<T as FallbackComponent>::Value> where
T: FallbackComponent,
pub fn get_with_fallback<T>(&self) -> Option<&<T as FallbackComponent>::Value> where
T: FallbackComponent,
Returns the style component of type T
, if present.
pub fn get_or_default<T>(&self) -> T where
T: StyleComponent + Default + Clone,
pub fn get_or_default<T>(&self) -> T where
T: StyleComponent + Default + Clone,
Returns the style component of type T
. If not present, T::default()
will be returned.
impl Style
impl Style
pub fn merge_with(&self, other: &Style, is_inheritance: bool) -> Style
pub fn merge_with(&self, other: &Style, is_inheritance: bool) -> Style
Returns a new Style
merging the components of self
with other
.
If both self
and other
contain a value of the same type, the value
in self
will be used.
When is_inheritence
is true
, values from other
will not be used if
StyleComponent::should_be_inherited
return false.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Style
impl !UnwindSafe for Style
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more