use crate::prelude::*; use anyhow::Result; use assetpath::AssetPath; use std::any::Any; use std::collections::HashMap; use std::sync::{Arc, Mutex, RwLock}; struct State { name: String, top_level_gui: Arc, on_activate: RwLock Result<()> + Send + Sync>>>, on_deactivate: RwLock Result<()> + Send + Sync>>>, next_tab: RwLock Result<()> + Send + Sync>>>, previous_tab: RwLock Result<()> + Send + Sync>>>, decline: RwLock Result<()> + Send + Sync>>>, } /// Opaque handle for a State /// only used for updating callbacks #[derive(Clone)] pub struct StateHandle { state: Arc, } impl StateHandle { pub fn update<'a>(&self, update_type: StateUpdateType<'a>) -> Result<()> { self.state.update(update_type) } } impl GetElement