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)]
pub struct Database {
__: char,
_a: char,
__: u8,
_a: u8,
pub ns: String,
_b: char,
_b: u8,
pub db: String,
}
@ -30,10 +30,10 @@ pub fn new(ns: &str, db: &str) -> Database {
impl Database {
pub fn new(ns: String, db: String) -> Database {
Database {
__: '/',
_a: '*',
__: 0x2f, // /
_a: 0x2a, // *
ns,
_b: '*',
_b: 0x2a, // *
db,
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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