Trait DialogWidget

Source
pub trait DialogWidget<Global, Event, Error>
where Global: 'static, Event: 'static + Send, Error: 'static + Send,
{ type State: DialogState<Global, Event, Error> + ?Sized; // Required method fn render( &self, area: Rect, buf: &mut Buffer, state: &mut Self::State, ctx: &mut RenderContext<'_, Global>, ) -> Result<(), Error>; }
Expand description

DialogWidget mimics AppWidget.

This needs a separate trait otherwise DialogState would need to be an AppState too, which is rather inconvenient.

Required Associated Types§

Source

type State: DialogState<Global, Event, Error> + ?Sized

Type of the State.

Required Methods§

Source

fn render( &self, area: Rect, buf: &mut Buffer, state: &mut Self::State, ctx: &mut RenderContext<'_, Global>, ) -> Result<(), Error>

Renders an application widget.

Implementors§

Source§

impl<Global, Event, Error> DialogWidget<Global, Event, Error> for FileDialog
where for<'a> &'a Event: TryFrom<&'a Event>, Global: 'static, Event: Send + 'static, Error: Send + 'static + From<Error>,

Source§

type State = dyn DialogState<Global, Event, Error>

Source§

impl<Global, Event, Error> DialogWidget<Global, Event, Error> for MsgDialog
where Global: 'static, Event: Send + 'static, Error: Send + 'static, for<'a> &'a Event: TryFrom<&'a Event>,

Source§

type State = dyn DialogState<Global, Event, Error>