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 Freeze for State
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