diff --git a/Cargo.toml b/Cargo.toml index 5fbc86e..f85077a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,4 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +db = { path = "db" } \ No newline at end of file diff --git a/db/Cargo.toml b/db/Cargo.toml new file mode 100644 index 0000000..b85f1d6 --- /dev/null +++ b/db/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "db" +version = "0.1.0" +authors = ["Jon Janzen "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/db/src/lib.rs b/db/src/lib.rs new file mode 100644 index 0000000..8fd15ea --- /dev/null +++ b/db/src/lib.rs @@ -0,0 +1,26 @@ +struct DBHeader { + magic: u8, + major_version: u8, // actually u4 in data + minor_version: u8, // actually u4 in data + reserved: u16, + record_count: u32, +} + +struct RecordHeader { + field_count: u8, + length: u8, + crc: u16, +} + +struct Field { + field_type: u8, + value: String, +} + +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + assert_eq!(2 + 2, 4); + } +}