pub struct Styles(/* private fields */);
Implementations§
source§impl Styles
impl Styles
pub fn with(self, style: impl Style) -> Self
pub fn insert<S: Style>(&mut self, style: S) -> Option<Box<dyn Style>>
pub fn with_all(self, styles: &Styles) -> Self
pub fn insert_all(&mut self, styles: &Styles)
pub fn get(&self, key: &str) -> Option<&dyn Style>
pub fn take(&mut self, key: &str) -> Option<Box<dyn Style>>
sourcepub fn assert_assignability<S>(&self, check: impl FnMut(Assignability) -> bool)
pub fn assert_assignability<S>(&self, check: impl FnMut(Assignability) -> bool)
Verifies the assignability of all styles by evaluating the given check
predicate, panicking
if the predicate evaluates to false
for any style. The type S
is used purely for generating the
panic message.
Panics
If one of the styles is assignment-incompatible according to the predicate.
Trait Implementations§
source§impl<'a> IntoIterator for &'a Styles
impl<'a> IntoIterator for &'a Styles
Auto Trait Implementations§
impl !RefUnwindSafe for Styles
impl !Send for Styles
impl !Sync for Styles
impl Unpin for Styles
impl !UnwindSafe for Styles
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