pub trait DialogState<Global, Event, Error>: Any{
// Required methods
fn active(&self) -> bool;
fn event(
&mut self,
event: &Event,
ctx: &mut AppContext<'_, Global, Event, Error>,
) -> Result<Control<Event>, Error>;
}
Expand description
Trait for a dialogs state.
A separate trait is necessary because this needs Any in the vtable. It mimics AppState without a few lifecycle functions.
Required Methods§
Implementations§
Source§impl<Global, Event, Error> dyn DialogState<Global, Event, Error>
impl<Global, Event, Error> dyn DialogState<Global, Event, Error>
Sourcepub fn downcast_ref<R: DialogState<Global, Event, Error>>(&self) -> Option<&R>
pub fn downcast_ref<R: DialogState<Global, Event, Error>>(&self) -> Option<&R>
down cast Any style.
Sourcepub fn downcast_mut<R: DialogState<Global, Event, Error>>(
&mut self,
) -> Option<&mut R>
pub fn downcast_mut<R: DialogState<Global, Event, Error>>( &mut self, ) -> Option<&mut R>
down cast Any style.