pub enum Class {
Value(bool),
Fn(Scope, Box<dyn Fn() -> bool + 'static, Global>),
}
Expand description
Represents the different possible values a single class on an element could have,
allowing you to do fine-grained updates to single items
in Element.classList
.
This mostly exists for the view
macro’s use. You usually won’t need to interact with it directly, but it can be useful for defining
permissive APIs for certain components.
Variants§
Value(bool)
Whether the class is present.
Fn(Scope, Box<dyn Fn() -> bool + 'static, Global>)
A (presumably reactive) function, which will be run inside an effect to toggle the class.
Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Class
impl !Send for Class
impl !Sync for Class
impl Unpin for Class
impl !UnwindSafe for Class
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