pub trait Dialog: Sized {
type Update;
type Output;
// Required methods
fn update_for_event(event: Event) -> Option<Self::Update>;
fn perform_update(&mut self, update: Self::Update) -> Result<()>;
fn state(&self) -> DialogState;
fn output(self) -> Self::Output;
fn viewport(&self) -> Viewport;
fn draw(&mut self, frame: &mut Frame<'_>);
// Provided methods
fn run(self) -> Result<Self::Output> { ... }
fn tick(&mut self) -> bool { ... }
fn tick_rate(&self) -> Duration { ... }
fn timeout(&self) -> Option<Duration> { ... }
}
Required Associated Types§
Required Methods§
fn update_for_event(event: Event) -> Option<Self::Update>
fn perform_update(&mut self, update: Self::Update) -> Result<()>
fn state(&self) -> DialogState
fn output(self) -> Self::Output
fn viewport(&self) -> Viewport
fn draw(&mut self, frame: &mut Frame<'_>)
Provided Methods§
fn tick(&mut self) -> bool
fn tick_rate(&self) -> Duration
fn timeout(&self) -> Option<Duration>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.