M Cargo.lock => Cargo.lock +12 -0
@@ 117,6 117,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6"
[[package]]
+name = "api"
+version = "0.1.0"
+
+[[package]]
name = "approx"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3768,6 3772,10 @@ dependencies = [
]
[[package]]
+name = "server"
+version = "0.1.0"
+
+[[package]]
name = "sha1"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ 3792,6 3800,10 @@ dependencies = [
]
[[package]]
+name = "shared"
+version = "0.1.0"
+
+[[package]]
name = "shlex"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
M Cargo.toml => Cargo.toml +4 -1
@@ 2,5 2,8 @@
resolver = "2"
members = [
- "client"
+ "shared",
+ "client",
+ "server",
+ "api"
]
A api/Cargo.toml => api/Cargo.toml +8 -0
@@ 0,0 1,8 @@
+[package]
+name = "api"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
A api/src/main.rs => api/src/main.rs +3 -0
@@ 0,0 1,3 @@
+fn main() {
+ println!("Hello, world!");
+}
A shared/Cargo.toml => shared/Cargo.toml +8 -0
@@ 0,0 1,8 @@
+[package]
+name = "shared"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
A shared/src/lib.rs => shared/src/lib.rs +14 -0
@@ 0,0 1,14 @@
+pub fn add(left: usize, right: usize) -> usize {
+ left + right
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn it_works() {
+ let result = add(2, 2);
+ assert_eq!(result, 4);
+ }
+}