use crate::prelude::*; use anyhow::{Result, anyhow}; use ecs::World; use std::collections::HashMap; use std::sync::{Arc, RwLock, Weak}; /// Opaque handle for a State /// only used for updating callbacks #[derive(Clone)] pub struct StateHandle { state: Weak, } impl StateHandle { pub fn update<'a>(&self, update_type: StateUpdateType<'a>) -> Result<()> { self.state.upgrade().unwrap().update(update_type) } } impl GetElement