version = "0.0.1"
dependencies = [
"anyhow",
- "handy",
"lazy_static",
"rocket",
"rocket_contrib",
"serde",
"serde_json",
+ "slotmap",
"thiserror",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
-[[package]]
-name = "handy"
-version = "0.1.3"
-
[[package]]
name = "hermit-abi"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
+[[package]]
+name = "slotmap"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c46a3482db8f247956e464d783693ece164ca056e6e67563ee5505bdb86452cd"
+
[[package]]
name = "slug"
version = "0.1.4"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
-handy = "0.1"
lazy_static = "1.0.0"
+slotmap = "0.4"
+
rocket = "0.4"
rocket_contrib = { version = "0.4", default-features=false, features=["tera_templates","helmet"] }
use crate::imports::*;
use lazy_static::lazy_static;
-type UserId = TypedHandle<User>;
-type ClientId = TypedHandle<Client>;
+slotmap::new_key_type!{
+ struct UserId;
+ struct ClientId;
+}
#[derive(Clone,Debug,Eq,PartialEq,Ord,PartialOrd,Hash)]
struct RawToken (String);
struct Instance {
/* game state goes here */
- users : TypedHandleMap<User>,
- clients : TypedHandleMap<Client>,
+ users : DenseSlotMap<UserId,User>,
+ clients : DenseSlotMap<ClientId,Client>,
}
#[derive(Clone)]
pub use rocket::response::NamedFile;
pub use rocket::response;
-pub use handy::typed::{TypedHandle,TypedHandleMap};
+pub use slotmap::dense::{DenseSlotMap};
pub type E = anyhow::Error;