Struct stylecs::AnyComponent
source · pub struct AnyComponent(_);
Expand description
A boxed StyleComponent
.
Implementations§
source§impl AnyComponent
impl AnyComponent
sourcepub fn new<C: DynamicComponent + Clone>(component: C) -> Self
pub fn new<C: DynamicComponent + Clone>(component: C) -> Self
Returns a new instance wrapping component
.
sourcepub fn get<T: StyleComponent>(&self) -> Option<&T>
pub fn get<T: StyleComponent>(&self) -> Option<&T>
Returns the contained style component. Returns None
if T
is not the
same type that was wrapped.
sourcepub fn get_mut<T: StyleComponent>(&mut self) -> Option<&mut T>
pub fn get_mut<T: StyleComponent>(&mut self) -> Option<&mut T>
Returns the contained style component. Returns None
if T
is not the
same type that was wrapped.
sourcepub fn inherited(&self) -> bool
pub fn inherited(&self) -> bool
Returns the result of DynamicComponent::inherited
.
sourcepub fn merge_with(&mut self, other: &Self)
pub fn merge_with(&mut self, other: &Self)
Calls DynamicComponent::merge
to merge self
with other
.
Panics
This function panics if other
does not wrap the same type as self
is
wrapping.
sourcepub fn merged_with(self, other: &Self) -> Self
pub fn merged_with(self, other: &Self) -> Self
Calls DynamicComponent::merge
and returns the updated value.
Panics
This function panics if other
does not wrap the same type as self
is
wrapping.
Trait Implementations§
source§impl Clone for AnyComponent
impl Clone for AnyComponent
Auto Trait Implementations§
impl RefUnwindSafe for AnyComponent
impl Send for AnyComponent
impl Sync for AnyComponent
impl Unpin for AnyComponent
impl UnwindSafe for AnyComponent
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