Skip to content

Instantly share code, notes, and snippets.

@Aceeri
Created November 7, 2016 06:17
Show Gist options
  • Select an option

  • Save Aceeri/d595b2ceff9ad6facd8a95e4427eb1f8 to your computer and use it in GitHub Desktop.

Select an option

Save Aceeri/d595b2ceff9ad6facd8a95e4427eb1f8 to your computer and use it in GitHub Desktop.
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