impl RawToken {
#[throws(OE)]
- fn new_random() -> Self {
+ pub fn new_random() -> Self {
let mut rng = thread_rng();
let token = RawToken (
repeat_with(|| rng.sample(Alphanumeric))
pub mod http;
pub mod session;
pub mod api;
+pub mod spec;
#[path="slotmap-slot-idx.rs"] pub mod slotmap_slot_idx;
g : iad.g.clone(),
ident : client,
};
- let ctoken = record_token(&mut ig, ciad);
+ let ctoken = record_token(&mut ig, ciad)?;
let ig = &mut *ig;
let mut uses = vec![];
--- /dev/null
+
+#![allow(dead_code)]
+
+use crate::imports::*;
+
+struct GameSpec {
+ players : Vec<PlayerSpec>
+}
+
+struct PlayerSpec {
+ nick: String,
+ access: Box<dyn PlayerAccessSpec>,
+}
+
+trait PlayerAccessSpec {
+ #[throws(OE)]
+ fn make_token(&self) -> RawToken { RawToken::new_random()? }
+}