Use u8 instead of char for datastpre key separators

This commit is contained in:
Tobie Morgan Hitchcock 2022-03-16 15:33:43 +00:00
parent ba8dd7bd12
commit cdef111786
20 changed files with 223 additions and 223 deletions

View file

@ -4,10 +4,10 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Database { pub struct Database {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
} }
@ -30,10 +30,10 @@ pub fn new(ns: &str, db: &str) -> Database {
impl Database { impl Database {
pub fn new(ns: String, db: String) -> Database { pub fn new(ns: String, db: String) -> Database {
Database { Database {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
} }
} }

View file

@ -4,12 +4,12 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Db { pub struct Db {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
_c: char, _c: u8,
_d: char, _d: u8,
pub db: String, pub db: String,
} }
@ -32,12 +32,12 @@ pub fn new(ns: &str, db: &str) -> Db {
impl Db { impl Db {
pub fn new(ns: String, db: String) -> Db { pub fn new(ns: String, db: String) -> Db {
Db { Db {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '!', _b: 0x21, // !
_c: 'd', _c: 0x64, // d
_d: 'b', _d: 0x02, // b
db, db,
} }
} }

View file

@ -4,14 +4,14 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Dl { pub struct Dl {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
_d: char, _d: u8,
_e: char, _e: u8,
pub dl: String, pub dl: String,
} }
@ -34,14 +34,14 @@ pub fn new(ns: &str, db: &str, dl: &str) -> Dl {
impl Dl { impl Dl {
pub fn new(ns: String, db: String, dl: String) -> Dl { pub fn new(ns: String, db: String, dl: String) -> Dl {
Dl { Dl {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '!', _c: 0x21, // !
_d: 'd', _d: 0x64, // d
_e: 'l', _e: 0x6c, // l
dl, dl,
} }
} }

View file

@ -4,14 +4,14 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Dt { pub struct Dt {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
_d: char, _d: u8,
_e: char, _e: u8,
pub tk: String, pub tk: String,
} }
@ -34,14 +34,14 @@ pub fn new(ns: &str, db: &str, tb: &str) -> Dt {
impl Dt { impl Dt {
pub fn new(ns: String, db: String, tk: String) -> Dt { pub fn new(ns: String, db: String, tk: String) -> Dt {
Dt { Dt {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '!', _c: 0x21, // !
_d: 'd', _d: 0x64, // d
_e: 't', _e: 0x74, // t
tk, tk,
} }
} }

View file

@ -4,16 +4,16 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Ev { pub struct Ev {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
_d: char, _d: u8,
_e: char, _e: u8,
_f: char, _f: u8,
pub ev: String, pub ev: String,
} }
@ -36,16 +36,16 @@ pub fn new(ns: &str, db: &str, tb: &str, ev: &str) -> Ev {
impl Ev { impl Ev {
pub fn new(ns: String, db: String, tb: String, ev: String) -> Ev { pub fn new(ns: String, db: String, tb: String, ev: String) -> Ev {
Ev { Ev {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
_d: '!', _d: 0x21, // !
_e: 'e', _e: 0x65, // e
_f: 'v', _f: 0x76, // v
ev, ev,
} }
} }

View file

@ -4,16 +4,16 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Fd { pub struct Fd {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
_d: char, _d: u8,
_e: char, _e: u8,
_f: char, _f: u8,
pub fd: String, pub fd: String,
} }
@ -36,16 +36,16 @@ pub fn new(ns: &str, db: &str, tb: &str, fd: &str) -> Fd {
impl Fd { impl Fd {
pub fn new(ns: String, db: String, tb: String, fd: String) -> Fd { pub fn new(ns: String, db: String, tb: String, fd: String) -> Fd {
Fd { Fd {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
_d: '!', _d: 0x21, // !
_e: 'f', _e: 0x66, // f
_f: 'd', _f: 0x64, // d
fd, fd,
} }
} }

View file

@ -4,16 +4,16 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Ft { pub struct Ft {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
_d: char, _d: u8,
_e: char, _e: u8,
_f: char, _f: u8,
pub ft: String, pub ft: String,
} }
@ -36,16 +36,16 @@ pub fn new(ns: &str, db: &str, tb: &str, ft: &str) -> Ft {
impl Ft { impl Ft {
pub fn new(ns: String, db: String, tb: String, ft: String) -> Ft { pub fn new(ns: String, db: String, tb: String, ft: String) -> Ft {
Ft { Ft {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
_d: '!', _d: 0x21, // !
_e: 'f', _e: 0x66, // f
_f: 't', _f: 0x74, // t
ft, ft,
} }
} }

View file

@ -5,14 +5,14 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Index { pub struct Index {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
_d: char, _d: u8,
pub ix: String, pub ix: String,
pub fd: Value, pub fd: Value,
} }
@ -36,14 +36,14 @@ pub fn new(ns: &str, db: &str, tb: &str, ix: &str, fd: Value) -> Index {
impl Index { impl Index {
pub fn new(ns: String, db: String, tb: String, ix: String, fd: Value) -> Index { pub fn new(ns: String, db: String, tb: String, ix: String, fd: Value) -> Index {
Index { Index {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
_d: '¤', _d: 0xa4, // ¤
ix, ix,
fd, fd,
} }

View file

@ -4,16 +4,16 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Ix { pub struct Ix {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
_d: char, _d: u8,
_e: char, _e: u8,
_f: char, _f: u8,
pub ix: String, pub ix: String,
} }
@ -36,16 +36,16 @@ pub fn new(ns: &str, db: &str, tb: &str, ix: &str) -> Ix {
impl Ix { impl Ix {
pub fn new(ns: String, db: String, tb: String, ix: String) -> Ix { pub fn new(ns: String, db: String, tb: String, ix: String) -> Ix {
Ix { Ix {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
_d: '!', _d: 0x21, // !
_e: 'i', _e: 0x69, // i
_f: 'x', _f: 0x78, // x
ix, ix,
} }
} }

View file

@ -4,16 +4,16 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Lv { pub struct Lv {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
_d: char, _d: u8,
_e: char, _e: u8,
_f: char, _f: u8,
pub lv: String, pub lv: String,
} }
@ -36,16 +36,16 @@ pub fn new(ns: &str, db: &str, tb: &str, lv: &str) -> Lv {
impl Lv { impl Lv {
pub fn new(ns: String, db: String, tb: String, lv: String) -> Lv { pub fn new(ns: String, db: String, tb: String, lv: String) -> Lv {
Lv { Lv {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
_d: '!', _d: 0x21, // !
_e: 'l', _e: 0x6c, // l
_f: 'v', _f: 0x76, // v
lv, lv,
} }
} }

View file

@ -4,8 +4,8 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Namespace { pub struct Namespace {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
} }
@ -28,8 +28,8 @@ pub fn new(ns: &str) -> Namespace {
impl Namespace { impl Namespace {
pub fn new(ns: String) -> Namespace { pub fn new(ns: String) -> Namespace {
Namespace { Namespace {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
} }
} }

View file

@ -4,12 +4,12 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Nl { pub struct Nl {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
_c: char, _c: u8,
_d: char, _d: u8,
pub us: String, pub us: String,
} }
@ -32,12 +32,12 @@ pub fn new(ns: &str, us: &str) -> Nl {
impl Nl { impl Nl {
pub fn new(ns: String, us: String) -> Nl { pub fn new(ns: String, us: String) -> Nl {
Nl { Nl {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '!', _b: 0x21, // !
_c: 'n', _c: 0x6e, // n
_d: 'l', _d: 0x6c, // l
us, us,
} }
} }

View file

@ -4,10 +4,10 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Ns { pub struct Ns {
__: char, __: u8,
_a: char, _a: u8,
_b: char, _b: u8,
_c: char, _c: u8,
pub ns: String, pub ns: String,
} }
@ -30,10 +30,10 @@ pub fn new(ns: &str) -> Ns {
impl Ns { impl Ns {
pub fn new(ns: String) -> Ns { pub fn new(ns: String) -> Ns {
Ns { Ns {
__: '/', __: 0x2f, // /
_a: '!', _a: 0x21, // !
_b: 'n', _b: 0x6e, // n
_c: 's', _c: 0x73, // s
ns, ns,
} }
} }

View file

@ -4,12 +4,12 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Nt { pub struct Nt {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
_c: char, _c: u8,
_d: char, _d: u8,
pub tk: String, pub tk: String,
} }
@ -32,12 +32,12 @@ pub fn new(ns: &str, tk: &str) -> Nt {
impl Nt { impl Nt {
pub fn new(ns: String, tk: String) -> Nt { pub fn new(ns: String, tk: String) -> Nt {
Nt { Nt {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '!', _b: 0x21, // !
_c: 'n', _c: 0x6e, // n
_d: 't', _d: 0x74, // t
tk, tk,
} }
} }

View file

@ -5,14 +5,14 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Point { pub struct Point {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
_d: char, _d: u8,
pub ix: String, pub ix: String,
pub fd: Value, pub fd: Value,
pub id: String, pub id: String,
@ -37,14 +37,14 @@ pub fn new(ns: &str, db: &str, tb: &str, ix: &str, fd: Value, id: &str) -> Point
impl Point { impl Point {
pub fn new(ns: String, db: String, tb: String, ix: String, fd: Value, id: String) -> Point { pub fn new(ns: String, db: String, tb: String, ix: String, fd: Value, id: String) -> Point {
Point { Point {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
_d: '¤', _d: 0xa4, // ¤
ix, ix,
fd, fd,
id, id,

View file

@ -4,14 +4,14 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Sc { pub struct Sc {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
_d: char, _d: u8,
_e: char, _e: u8,
pub sc: String, pub sc: String,
} }
@ -34,14 +34,14 @@ pub fn new(ns: &str, db: &str, sc: &str) -> Sc {
impl Sc { impl Sc {
pub fn new(ns: String, db: String, sc: String) -> Sc { pub fn new(ns: String, db: String, sc: String) -> Sc {
Sc { Sc {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '!', _c: 0x21, // !
_d: 's', _d: 0x73, // s
_e: 'c', _e: 0x63, // c
sc, sc,
} }
} }

View file

@ -4,18 +4,18 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct St { pub struct St {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
_d: char, _d: u8,
_e: char, _e: u8,
pub sc: String, pub sc: String,
_f: char, _f: u8,
_g: char, _g: u8,
_h: char, _h: u8,
pub tk: String, pub tk: String,
} }
@ -38,18 +38,18 @@ pub fn new(ns: &str, db: &str, sc: &str, tk: &str) -> St {
impl St { impl St {
pub fn new(ns: String, db: String, sc: String, tk: String) -> St { pub fn new(ns: String, db: String, sc: String, tk: String) -> St {
St { St {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '!', _c: 0x21, // !
_d: 's', _d: 0x73, // s
_e: 't', _e: 0x74, // t
sc, sc,
_f: '!', _f: 0x21, // !
_g: 't', _g: 0x74, // t
_h: 'k', _h: 0x6b, // k
tk, tk,
} }
} }

View file

@ -4,12 +4,12 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Table { pub struct Table {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
} }
@ -32,12 +32,12 @@ pub fn new(ns: &str, db: &str, tb: &str) -> Table {
impl Table { impl Table {
pub fn new(ns: String, db: String, tb: String) -> Table { pub fn new(ns: String, db: String, tb: String) -> Table {
Table { Table {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
} }
} }

View file

@ -4,14 +4,14 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Tb { pub struct Tb {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
_d: char, _d: u8,
_e: char, _e: u8,
pub tb: String, pub tb: String,
} }
@ -34,14 +34,14 @@ pub fn new(ns: &str, db: &str, tb: &str) -> Tb {
impl Tb { impl Tb {
pub fn new(ns: String, db: String, tb: String) -> Tb { pub fn new(ns: String, db: String, tb: String) -> Tb {
Tb { Tb {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '!', _c: 0x21, // !
_d: 't', _d: 0x74, // t
_e: 'b', _e: 0x62, // b
tb, tb,
} }
} }

View file

@ -4,15 +4,15 @@ use storekey::{deserialize, serialize};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Thing { pub struct Thing {
__: char, __: u8,
_a: char, _a: u8,
pub ns: String, pub ns: String,
_b: char, _b: u8,
pub db: String, pub db: String,
_c: char, _c: u8,
pub tb: String, pub tb: String,
_d: char, _d: u8,
pub id: String, pub id: Part<Id>,
} }
impl From<Thing> for Vec<u8> { impl From<Thing> for Vec<u8> {
@ -40,14 +40,14 @@ pub fn new(ns: &str, db: &str, tb: &str, id: &str) -> Thing {
impl Thing { impl Thing {
pub fn new(ns: String, db: String, tb: String, id: String) -> Thing { pub fn new(ns: String, db: String, tb: String, id: String) -> Thing {
Thing { Thing {
__: '/', __: 0x2f, // /
_a: '*', _a: 0x2a, // *
ns, ns,
_b: '*', _b: 0x2a, // *
db, db,
_c: '*', _c: 0x2a, // *
tb, tb,
_d: '*', _d: 0x2a, // *
id, id,
} }
} }