Created
November 7, 2016 06:17
-
-
Save Aceeri/d595b2ceff9ad6facd8a95e4427eb1f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::any::Any; | |
| use std::collections::HashMap; | |
| struct VecStorage<T> { | |
| list: Vec<T>, | |
| } | |
| trait Component: Any + Sized { | |
| type Storage: Any + Send + Sync; | |
| } | |
| struct RuntimeVecComponent { | |
| data: HashMap<String, String>, | |
| } | |
| impl Component for RuntimeVecComponent { | |
| type Storage = VecStorage<RuntimeVecComponent>; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment