pub async fn run(&self, term: &mut Terminal) -> Result<(), ServicesOff> {
        self.render(term.lock_now().await?.screen());

        loop {
            let mut session = term.listen().await?;
            match session.event() {
                Some(Event::Key(KeyEvent {
                    main_key: Key::Enter,
                    ctrl: false,
                    alt: false,
                    shift: false,
                }))
                | Some(Event::Key(KeyEvent {
                    main_key: Key::Esc,
                    ctrl: false,
                    alt: false,
                    shift: false,
                })) if session.screen().valid_size() => break Ok(()),

                Some(Event::Resize(evt)) => {
                    if evt.size.is_some() {
                        self.render(session.screen());
                    }
                },

                _ => (),
            }
        }
    }
/// Runs this dialog showing it to the user, awaiting OK!
Runs this dialog showing it to the user, awaiting OK!
Runs this dialog showing it to the user awaiting OK!
pub async fn run(&self, term: &mut Terminal) -> Result<(), ServicesOff> {
        self.render(term.lock_now().await?.screen());
        loop {
            let mut session = term.listen().await?;
            match session.event() {
                Some(Event::Key(KeyEvent {
                    main_key: Key::Enter,
                    ctrl: false,
                    alt: false,
                    shift: false,
                }))
                | Some(Event::Key(KeyEvent {
                    main_key: Key::Esc,
                    ctrl: false,
                    alt: false,
                    shift: false,
                })) if session.screen().valid_size() => break Ok(()),
                Some(Event::Resize(evt)) => {
                    if evt.size.is_some() {
                        self.render(session.screen());
                    }
                },
                _ => (),
            }
        }
    }
pub async fn run ( & self , term : & mut Terminal ) -> Result < ( ) , ServicesOff > { self . render ( term . lock_now ( ) . await ? . screen ( ) ) ; loop { let mut session = term . listen ( ) . await ? ; match session . event ( ) { Some ( Event :: Key ( KeyEvent { main_key : Key :: Enter , ctrl : false , alt : false , shift : false , } ) ) | Some ( Event :: Key ( KeyEvent { main_key : Key :: Esc , ctrl : false , alt : false , shift : false , } ) ) if session . screen ( ) . valid_size ( ) => break Ok ( ( ) ) , Some ( Event :: Resize ( evt ) ) => { if evt . size . is_some ( ) { self . render ( session . screen ( ) ) ; } } , _ => ( ) , } } }
Runs this dialog showing it to the user, awaiting OK!
Runs this dialog showing it to the user awaiting OK!
&self
term
&mut Terminal
&self
term
&mut Terminal