pub struct StyleModifier(/* private fields */);Expand description
Utility to modify a Style in some way.
Constructed via StyleModifier::from from a Fn(&mut Style) or a Style.
Implementations§
Source§impl StyleModifier
impl StyleModifier
Sourcepub fn new(f: impl Fn(&mut Style) + Send + Sync + 'static) -> StyleModifier
pub fn new(f: impl Fn(&mut Style) + Send + Sync + 'static) -> StyleModifier
Create a new StyleModifier from a function.
Sourcepub fn apply(&self, style: &mut Style)
pub fn apply(&self, style: &mut Style)
Apply the modification to the given Style.
Usually used with Ui::style_mut.
Trait Implementations§
Source§impl Clone for StyleModifier
impl Clone for StyleModifier
Source§fn clone(&self) -> StyleModifier
fn clone(&self) -> StyleModifier
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StyleModifier
impl Debug for StyleModifier
Source§impl Default for StyleModifier
impl Default for StyleModifier
Source§fn default() -> StyleModifier
fn default() -> StyleModifier
Returns the “default value” for a type. Read more
Source§impl From<Style> for StyleModifier
impl From<Style> for StyleModifier
Source§fn from(style: Style) -> StyleModifier
fn from(style: Style) -> StyleModifier
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for StyleModifier
impl !UnwindSafe for StyleModifier
impl Forget for StyleModifier
impl Freeze for StyleModifier
impl Move for StyleModifier
impl Send for StyleModifier
impl Sync for StyleModifier
impl Unpin for StyleModifier
impl UnsafeUnpin for StyleModifier
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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