You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: update.rs
    path of file: ./repos/termscp/src/ui/activities/setup
    
    the code of the file until where you have to start completion: //! ## SetupActivity
//!
//! `setup_activity` is the module which implements the Setup activity, which is the activity to
//! work on termscp configuration

// locals
// ext
use tuirealm::Update;

use super::{
    CommonMsg, ConfigMsg, Id, IdConfig, IdSsh, IdTheme, Msg, SetupActivity, SshMsg, ThemeMsg,
    ViewLayout,
};

impl Update<Msg> for SetupActivity {
    /// Update auth activity model based on msg
    /// The function exits when returns None
    fn update(&mut self, msg: Option<Msg>) -> Option<Msg> {
        match msg.unwrap_or(Msg::None) {
            Msg::Common(msg) => self.common_update(msg),
            Msg::Config(msg) => self.config_update(msg),
            Msg::Ssh(msg) => self.ssh_update(msg),
            Msg::The
    
    fn common_update(&mut self, msg: CommonMsg) -> Option<Msg> {
        match msg {
            CommonMsg::ChangeLayout => {
                let new_layout = match self.layout {
                    ViewLayout::SetupForm => ViewLayout::SshKeys,
                    ViewLayout::SshKeys => ViewLayout::Theme,
                    ViewLayout::Theme => ViewLayout::SetupForm,
                };
                if let Err(err) = self.action_change_tab(new_layout) {
                    self.mount_error(err.as_str());
                }
            }
            CommonMsg::CloseErrorPopup => {
                self.umount_error();
            }
            CommonMsg::CloseKeybindingsPopup => {
                self.umount_help();
            }
            CommonMsg::CloseQuitPopup => {
                self.umount_quit();
            }
            CommonMsg::CloseSavePopup => {
                self.umount_save_popup();
            }
            CommonMsg::Quit => {
                self.exit_reason = Some(super::ExitReason::Quit);
            }
            CommonMsg::RevertChanges => match self.layout {
                ViewLayout::Theme => {
                    if let Err(err) = self.action_reset_theme() {
                        error!("Failed to reset theme: {}", err);
                        self.mount_error(err);
                    }
                }
                ViewLayout::SshKeys | ViewLayout::SetupForm => {
                    if let Err(err) = self.action_reset_config() {
                        error!("Failed to reset config: {}", err);
                        self.mount_error(err);
                    }
                }
            },
            CommonMsg::SaveAndQuit => {
                // Save changes
                if let Err(err) = self.action_save_all() {
                    error!("Failed to save config: {}", err);
                    self.mount_error(err.as_str());
                }
                // Exit
                self.exit_reason = Some(super::ExitReason::Quit);
            }
            CommonMsg::SaveConfig => {
                if let Err(err) = self.action_save_all() {
                    error!("Failed to save config: {}", err);
                    self.mount_error(err.as_str());
                }
                self.umount_save_popup();
            }
            CommonMsg::ShowKeybindings => {
                self.mount_help();
            }
            CommonMsg::ShowQuitPopup => {
                self.action_on_esc();
            }
            CommonMsg::ShowSavePopup => {
                self.mount_save_popup();
            }
            CommonMsg::WindowResized => {
                self.redraw = true;
            }
        }
        None
    }