pub fn step(&mut self) -> bool {
        {
            if !self.is_running {
                return false;
            }
        }

        // Process any pending UI messages
        while let Some(message) = self.ui_rx.try_iter().next() {
            match message {
                UiMessage::AddToBookmarkMenu(bookmark) => {
                    self.add_to_bookmark_menu(bookmark);
                }
                UiMessage::AddToHistoryMenu(history_entry) => {
                    self.add_to_history_menu(history_entry);
                }
                UiMessage::BinaryWritten(filename, bytes_written) => {
                    self.binary_written(filename, bytes_written);
                }
                UiMessage::ClearHistoryMenu => {
                    self.clear_history_menu();
                }
                UiMessage::ClearBookmarksMenu => {
                    self.clear_bookmarks_menu();
                }
                UiMessage::PageSaved(_url, filename) => {
                    self.set_message(format!("Page saved as '{}'.", filename).as_str());
                }
                UiMessage::ShowAddBookmarkDialog(bookmark) => {
                    self.show_add_bookmark_dialog(bookmark);
                }
                UiMessage::ShowEditHistoryDialog(entries) => {
                    self.show_edit_history_dialog(entries);
                }
                UiMessage::ShowContent(url, content, item_type, index) => {
                    if ItemType::is_dir(item_type) {
                        self.show_gophermap(content, index);
                    } else if ItemType::is_text(item_type) {
                        self.show_text_file(content);
                    }
                    self.set_message(url.as_str());
                }
                UiMessage::ShowCertificateChangedDialog(url, fingerprint) => {
                    self.show_certificate_changed_dialog(url, fingerprint);
                }
                UiMessage::ShowGeminiContent(url, gemini_type, content) => {
                    if gemini_type == GeminiType::Text {
                        self.show_text_file(content);
                    } else {
                        self.show_gemini(&url, &content);
                    }
                    self.set_message(url.as_str());
                }
                UiMessage::MoveSelection(direction) => {
                    self.move_selection(direction);
                }
                UiMessage::MoveToLink(direction) => {
                    self.move_to_link(direction);
                }
                UiMessage::OpenQueryDialog(url) => {
                    self.open_query_dialog(url);
                }
                UiMessage::OpenGeminiQueryDialog(url, query) => {
                    self.open_gemini_query_dialog(url, query);
                }
                UiMessage::OpenQueryUrl(url) => {
                    self.query(url);
                }
                UiMessage::OpenUrl(url, add_to_history, index) => {
                    trace!("OpenUrl({}, {}, {})", url, add_to_history, index);
                    self.open_url(url, add_to_history, index);
                }
                UiMessage::OpenUrlFromString(url, add_to_history, index) => {
                    self.open_url_string(url, add_to_history, index);
                }
                // Exit the event loop
                UiMessage::Quit => self.is_running = false,
                UiMessage::ShowEditBookmarksDialog(bookmarks) => {
                    self.show_edit_bookmarks_dialog(bookmarks)
                }
                UiMessage::ShowLinkInfo => self.show_current_link_info(),
                UiMessage::ShowMessage(msg) => {
                    self.set_message(msg.as_str());
                }
                UiMessage::ShowURLDialog => {
                    self.show_url_dialog();
                }
                UiMessage::ShowSaveAsDialog(url) => {
                    self.show_save_as_dialog(url);
                }
                UiMessage::ShowSearchDialog(url) => {
                    self.show_search_dialog(url);
                }
                UiMessage::ShowSettingsDialog => {
                    self.show_settings_dialog();
                }
                UiMessage::Trigger => {
                    self.trigger();
                }
            }
        }

        // Step the UI
        let mut app = self.app.write().unwrap();
        app.step();

        true
    }
/// Step the UI by calling into Cursive's step function, then
/// processing any UI messages.
Step the UI by calling into Cursive's step function, then
processing any UI messages.
Step the UI by calling into Cursive ' s step function then processing any UI messages .
pub fn step(&mut self) -> bool {
        {
            if !self.is_running {
                return false;
            }
        }
        // Process any pending UI messages
        while let Some(message) = self.ui_rx.try_iter().next() {
            match message {
                UiMessage::AddToBookmarkMenu(bookmark) => {
                    self.add_to_bookmark_menu(bookmark);
                }
                UiMessage::AddToHistoryMenu(history_entry) => {
                    self.add_to_history_menu(history_entry);
                }
                UiMessage::BinaryWritten(filename, bytes_written) => {
                    self.binary_written(filename, bytes_written);
                }
                UiMessage::ClearHistoryMenu => {
                    self.clear_history_menu();
                }
                UiMessage::ClearBookmarksMenu => {
                    self.clear_bookmarks_menu();
                }
                UiMessage::PageSaved(_url, filename) => {
                    self.set_message(format!("Page saved as '{}'.", filename).as_str());
                }
                UiMessage::ShowAddBookmarkDialog(bookmark) => {
                    self.show_add_bookmark_dialog(bookmark);
                }
                UiMessage::ShowEditHistoryDialog(entries) => {
                    self.show_edit_history_dialog(entries);
                }
                UiMessage::ShowContent(url, content, item_type, index) => {
                    if ItemType::is_dir(item_type) {
                        self.show_gophermap(content, index);
                    } else if ItemType::is_text(item_type) {
                        self.show_text_file(content);
                    }
                    self.set_message(url.as_str());
                }
                UiMessage::ShowCertificateChangedDialog(url, fingerprint) => {
                    self.show_certificate_changed_dialog(url, fingerprint);
                }
                UiMessage::ShowGeminiContent(url, gemini_type, content) => {
                    if gemini_type == GeminiType::Text {
                        self.show_text_file(content);
                    } else {
                        self.show_gemini(&url, &content);
                    }
                    self.set_message(url.as_str());
                }
                UiMessage::MoveSelection(direction) => {
                    self.move_selection(direction);
                }
                UiMessage::MoveToLink(direction) => {
                    self.move_to_link(direction);
                }
                UiMessage::OpenQueryDialog(url) => {
                    self.open_query_dialog(url);
                }
                UiMessage::OpenGeminiQueryDialog(url, query) => {
                    self.open_gemini_query_dialog(url, query);
                }
                UiMessage::OpenQueryUrl(url) => {
                    self.query(url);
                }
                UiMessage::OpenUrl(url, add_to_history, index) => {
                    trace!("OpenUrl({}, {}, {})", url, add_to_history, index);
                    self.open_url(url, add_to_history, index);
                }
                UiMessage::OpenUrlFromString(url, add_to_history, index) => {
                    self.open_url_string(url, add_to_history, index);
                }
                // Exit the event loop
                UiMessage::Quit => self.is_running = false,
                UiMessage::ShowEditBookmarksDialog(bookmarks) => {
                    self.show_edit_bookmarks_dialog(bookmarks)
                }
                UiMessage::ShowLinkInfo => self.show_current_link_info(),
                UiMessage::ShowMessage(msg) => {
                    self.set_message(msg.as_str());
                }
                UiMessage::ShowURLDialog => {
                    self.show_url_dialog();
                }
                UiMessage::ShowSaveAsDialog(url) => {
                    self.show_save_as_dialog(url);
                }
                UiMessage::ShowSearchDialog(url) => {
                    self.show_search_dialog(url);
                }
                UiMessage::ShowSettingsDialog => {
                    self.show_settings_dialog();
                }
                UiMessage::Trigger => {
                    self.trigger();
                }
            }
        }
        // Step the UI
        let mut app = self.app.write().unwrap();
        app.step();
        true
    }
pub fn step ( & mut self ) -> bool { { if ! self . is_running { return false ; } } // Process any pending UI messages while let Some ( message ) = self . ui_rx . try_iter ( ) . next ( ) { match message { UiMessage :: AddToBookmarkMenu ( bookmark ) => { self . add_to_bookmark_menu ( bookmark ) ; } UiMessage :: AddToHistoryMenu ( history_entry ) => { self . add_to_history_menu ( history_entry ) ; } UiMessage :: BinaryWritten ( filename , bytes_written ) => { self . binary_written ( filename , bytes_written ) ; } UiMessage :: ClearHistoryMenu => { self . clear_history_menu ( ) ; } UiMessage :: ClearBookmarksMenu => { self . clear_bookmarks_menu ( ) ; } UiMessage :: PageSaved ( _url , filename ) => { self . set_message ( format ! ( " " filename ) . as_str ( ) ) ; } UiMessage :: ShowAddBookmarkDialog ( bookmark ) => { self . show_add_bookmark_dialog ( bookmark ) ; } UiMessage :: ShowEditHistoryDialog ( entries ) => { self . show_edit_history_dialog ( entries ) ; } UiMessage :: ShowContent ( url , content , item_type , index ) => { if ItemType :: is_dir ( item_type ) { self . show_gophermap ( content , index ) ; } else if ItemType :: is_text ( item_type ) { self . show_text_file ( content ) ; } self . set_message ( url . as_str ( ) ) ; } UiMessage :: ShowCertificateChangedDialog ( url , fingerprint ) => { self . show_certificate_changed_dialog ( url , fingerprint ) ; } UiMessage :: ShowGeminiContent ( url , gemini_type , content ) => { if gemini_type == GeminiType :: Text { self . show_text_file ( content ) ; } else { self . show_gemini ( & url , & content ) ; } self . set_message ( url . as_str ( ) ) ; } UiMessage :: MoveSelection ( direction ) => { self . move_selection ( direction ) ; } UiMessage :: MoveToLink ( direction ) => { self . move_to_link ( direction ) ; } UiMessage :: OpenQueryDialog ( url ) => { self . open_query_dialog ( url ) ; } UiMessage :: OpenGeminiQueryDialog ( url , query ) => { self . open_gemini_query_dialog ( url , query ) ; } UiMessage :: OpenQueryUrl ( url ) => { self . query ( url ) ; } UiMessage :: OpenUrl ( url , add_to_history , index ) => { trace ! ( " " url add_to_history index ) ; self . open_url ( url , add_to_history , index ) ; } UiMessage :: OpenUrlFromString ( url , add_to_history , index ) => { self . open_url_string ( url , add_to_history , index ) ; } // Exit the event loop UiMessage :: Quit => self . is_running = false , UiMessage :: ShowEditBookmarksDialog ( bookmarks ) => { self . show_edit_bookmarks_dialog ( bookmarks ) } UiMessage :: ShowLinkInfo => self . show_current_link_info ( ) , UiMessage :: ShowMessage ( msg ) => { self . set_message ( msg . as_str ( ) ) ; } UiMessage :: ShowURLDialog => { self . show_url_dialog ( ) ; } UiMessage :: ShowSaveAsDialog ( url ) => { self . show_save_as_dialog ( url ) ; } UiMessage :: ShowSearchDialog ( url ) => { self . show_search_dialog ( url ) ; } UiMessage :: ShowSettingsDialog => { self . show_settings_dialog ( ) ; } UiMessage :: Trigger => { self . trigger ( ) ; } } } // Step the UI let mut app = self . app . write ( ) . unwrap ( ) ; app . step ( ) ; true }
Step the UI by calling into Cursive's step function, then
processing any UI messages.
Step the UI by calling into Cursive ' s step function then processing any UI messages .
&mut self
&mut self