Skip to main content

rumtk_web_modify_state

Macro rumtk_web_modify_state 

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

Facility for modifying the state in an instance of SharedAppState.

ยงExample

use rumtk_core::rumtk_new_lock;
use rumtk_core::strings::RUMString;
use rumtk_web::{AppState, ClipboardID, SharedAppState};
use rumtk_web::rumtk_web_modify_state;

let state = rumtk_new_lock!(AppState::new());
let clipboard_id = ClipboardID::new("");

let item_list = rumtk_web_modify_state!(state).pop_clipboard(&clipboard_id);

assert_eq!(item_list, None, "A non empty item list was retrieved from the app state.");