pub enum State {
None,
Some(Box<dyn Any>),
}
Expand description
The internal State
of a widget.
Variants§
Implementations§
source§impl State
impl State
sourcepub fn downcast_ref<T>(&self) -> &Twhere
T: 'static,
pub fn downcast_ref<T>(&self) -> &Twhere
T: 'static,
Downcasts the State
to T
and returns a reference to it.
§Panics
This method will panic if the downcast fails or the State
is State::None
.
sourcepub fn downcast_mut<T>(&mut self) -> &mut Twhere
T: 'static,
pub fn downcast_mut<T>(&mut self) -> &mut Twhere
T: 'static,
Downcasts the State
to T
and returns a mutable reference to it.
§Panics
This method will panic if the downcast fails or the State
is State::None
.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for State
impl !Send for State
impl !Sync for State
impl Unpin for State
impl !UnwindSafe for State
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