1 2 3 4 5 6 7 8 9 10
pub use std::sync::Arc; pub trait HasComponent<C> { fn add(&mut self, name: &str, component: Arc<C>); fn get(&self, name: &str) -> Option<Arc<C>>; fn get_all(&self) -> Vec<(&str, Arc<C>)>; }
1 2 3 4 5 6 7 8 9 10
pub use std::sync::Arc; pub trait HasComponent<C> { fn add(&mut self, name: &str, component: Arc<C>); fn get(&self, name: &str) -> Option<Arc<C>>; fn get_all(&self) -> Vec<(&str, Arc<C>)>; }