Skip to main content

rumtk_web_set_config

Macro rumtk_web_set_config 

Source
macro_rules! rumtk_web_set_config {
    ( $state:expr ) => { ... };
}
Expand description

Set field or state in the configuration section of the SharedAppState object. The configuration is of type AppConf.

ยงExample

use rumtk_core::rumtk_new_lock;
use rumtk_core::strings::RUMString;
use rumtk_web::{AppState, ClipboardID, SharedAppState, AppConf};
use rumtk_web::{rumtk_web_set_config, rumtk_web_get_config};

let state = rumtk_new_lock!(AppState::new());
let lang = RUMString::from("en");

rumtk_web_set_config!(state).lang = RUMString::from(lang.clone());

let new_lang = rumtk_web_get_config!(state).lang.clone();

assert_eq!(new_lang, lang, "Changing the language field in the configuration was not successful!");