feat: domo_lib

This commit is contained in:
Strix 2023-11-30 21:52:56 +01:00
parent 7999ac6103
commit 2af49e31bc
No known key found for this signature in database
GPG key ID: 5F35B3B8537287A7
5 changed files with 129 additions and 0 deletions

92
domo_lib/Cargo.lock generated Normal file
View file

@ -0,0 +1,92 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "crc32fast"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
"cfg-if",
]
[[package]]
name = "domo_lib"
version = "0.1.0"
dependencies = [
"domo_proto",
]
[[package]]
name = "domo_proto"
version = "0.2.0"
dependencies = [
"crc32fast",
"rand",
]
[[package]]
name = "getrandom"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
dependencies = [
"cfg-if",
"libc",
"wasi",
]
[[package]]
name = "libc"
version = "0.2.150"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
[[package]]
name = "ppv-lite86"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "rand"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
"rand_chacha",
"rand_core",
]
[[package]]
name = "rand_chacha"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core",
]
[[package]]
name = "rand_core"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
"getrandom",
]
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"

9
domo_lib/Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "domo_lib"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
domo_proto = { path = "../domo_proto" }

1
domo_lib/src/lib.rs Normal file
View file

@ -0,0 +1 @@
pub mod node;

16
domo_lib/src/node/mod.rs Normal file
View file

@ -0,0 +1,16 @@
use std::collections::HashMap;
use domo_proto::identifier::Identifier;
use self::property::Property;
pub mod property;
pub struct Node {
/// Who owns this node?
pub parent: Option<Identifier>,
/// Identifier of node
pub identifier: Identifier,
/// Child nodes
pub children: HashMap<Identifier, Node>,
/// All properties of the node.
pub properties: HashMap<String, Property>
}

View file

@ -0,0 +1,11 @@
use domo_proto::data_types::DataType;
pub struct Property {
/// Is the property descriptive?
pub descriptive: bool,
pub name: String,
pub data: DataType
}
impl Property {
}