diff --git a/Cargo.toml b/Cargo.toml index 750d78b..9e17b2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,21 @@ [package] name = "frakt" -authors = ["James ", "Ronan ", "Charles "] +authors = ["James ", "Ronan ", "Charles ", "Samira "] version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "client" +path = "client/src/main.rs" -[dependencies] -serde = { version = "1.0.189", features = ["derive"] } -serde_json = "1.0.107" -image = "0.24.7" +[[bin]] +name = "server" +path = "server/src/main.rs" + +[workspace] +members = [ + "client", + "shared", + "server", + "complex", +] diff --git a/client/Cargo.toml b/client/Cargo.toml new file mode 100644 index 0000000..d5bd136 --- /dev/null +++ b/client/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "client" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + + +[dependencies.shared] +path = "../shared" diff --git a/client/src/calculations.rs b/client/src/calculations.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/client/src/calculations.rs @@ -0,0 +1 @@ + diff --git a/client/src/client.rs b/client/src/client.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/client/src/client.rs @@ -0,0 +1 @@ + diff --git a/client/src/main.rs b/client/src/main.rs new file mode 100644 index 0000000..926c69e --- /dev/null +++ b/client/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("[CLIENT] Hello, world!"); +} diff --git a/src/worker/mod.rs b/client/src/mod.rs similarity index 100% rename from src/worker/mod.rs rename to client/src/mod.rs diff --git a/complex/Cargo.toml b/complex/Cargo.toml new file mode 100644 index 0000000..08eeff6 --- /dev/null +++ b/complex/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "complex" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + + +[dependencies.shared] +path = "../shared" diff --git a/complex/src/complex_impl.rs b/complex/src/complex_impl.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/complex/src/complex_impl.rs @@ -0,0 +1 @@ + diff --git a/complex/src/lib.rs b/complex/src/lib.rs new file mode 100644 index 0000000..dcd5682 --- /dev/null +++ b/complex/src/lib.rs @@ -0,0 +1 @@ +pub mod complex_impl; diff --git a/server/Cargo.toml b/server/Cargo.toml new file mode 100644 index 0000000..acacadf --- /dev/null +++ b/server/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "server" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + + +[dependencies.shared] +path = "../shared" diff --git a/server/src/handler.rs b/server/src/handler.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/server/src/handler.rs @@ -0,0 +1 @@ + diff --git a/server/src/image.rs b/server/src/image.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/server/src/image.rs @@ -0,0 +1 @@ + diff --git a/server/src/main.rs b/server/src/main.rs new file mode 100644 index 0000000..b6dafd8 --- /dev/null +++ b/server/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("[SERVER] Hello, world!"); +} diff --git a/src/server/mod.rs b/server/src/mod.rs similarity index 100% rename from src/server/mod.rs rename to server/src/mod.rs diff --git a/shared/Cargo.toml b/shared/Cargo.toml new file mode 100644 index 0000000..886aebd --- /dev/null +++ b/shared/Cargo.toml @@ -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] diff --git a/src/common/mod.rs b/shared/src/lib.rs similarity index 50% rename from src/common/mod.rs rename to shared/src/lib.rs index b5614dd..b4ab6a6 100644 --- a/src/common/mod.rs +++ b/shared/src/lib.rs @@ -1 +1,2 @@ +pub mod types; pub mod utils; diff --git a/src/types/complex.rs b/shared/src/types/complex.rs similarity index 97% rename from src/types/complex.rs rename to shared/src/types/complex.rs index e9a0cff..eb5af30 100644 --- a/src/types/complex.rs +++ b/shared/src/types/complex.rs @@ -2,4 +2,4 @@ pub struct Complex { pub re: f64, pub im: f64, -} \ No newline at end of file +} diff --git a/src/types/messages.rs b/shared/src/types/messages.rs similarity index 99% rename from src/types/messages.rs rename to shared/src/types/messages.rs index e865623..c9f10f6 100644 --- a/src/types/messages.rs +++ b/shared/src/types/messages.rs @@ -29,4 +29,3 @@ pub struct FragmentResult { pub pixel_data: PixelData, pub pixel_intensity: Vec, } - diff --git a/src/types/mod.rs b/shared/src/types/mod.rs similarity index 100% rename from src/types/mod.rs rename to shared/src/types/mod.rs index ac67dab..762995b 100644 --- a/src/types/mod.rs +++ b/shared/src/types/mod.rs @@ -1,7 +1,7 @@ pub mod complex; pub mod messages; -pub mod pixel_intensity; pub mod pixel_data; +pub mod pixel_intensity; pub mod point; pub mod range; pub mod resolution; diff --git a/src/types/pixel_data.rs b/shared/src/types/pixel_data.rs similarity index 98% rename from src/types/pixel_data.rs rename to shared/src/types/pixel_data.rs index 70928b2..97a46a2 100644 --- a/src/types/pixel_data.rs +++ b/shared/src/types/pixel_data.rs @@ -2,4 +2,4 @@ pub struct PixelData { pub offset: u32, pub count: u32, -} \ No newline at end of file +} diff --git a/src/types/pixel_intensity.rs b/shared/src/types/pixel_intensity.rs similarity index 98% rename from src/types/pixel_intensity.rs rename to shared/src/types/pixel_intensity.rs index bdd2cf2..3cb22ca 100644 --- a/src/types/pixel_intensity.rs +++ b/shared/src/types/pixel_intensity.rs @@ -2,4 +2,4 @@ pub struct PixelIntensity { pub zn: f32, pub count: f32, -} \ No newline at end of file +} diff --git a/src/types/point.rs b/shared/src/types/point.rs similarity index 97% rename from src/types/point.rs rename to shared/src/types/point.rs index e5d397d..6f3397c 100644 --- a/src/types/point.rs +++ b/shared/src/types/point.rs @@ -2,4 +2,4 @@ pub struct Point { pub x: f64, pub y: f64, -} \ No newline at end of file +} diff --git a/src/types/range.rs b/shared/src/types/range.rs similarity index 98% rename from src/types/range.rs rename to shared/src/types/range.rs index 8c7cae5..ec111f1 100644 --- a/src/types/range.rs +++ b/shared/src/types/range.rs @@ -4,4 +4,4 @@ use crate::types::point::Point; pub struct Range { pub min: Point, pub max: Point, -} \ No newline at end of file +} diff --git a/src/types/resolution.rs b/shared/src/types/resolution.rs similarity index 97% rename from src/types/resolution.rs rename to shared/src/types/resolution.rs index 91d1435..a299bf9 100644 --- a/src/types/resolution.rs +++ b/shared/src/types/resolution.rs @@ -2,4 +2,4 @@ pub struct Resolution { pub nx: u16, pub ny: u16, -} \ No newline at end of file +} diff --git a/src/types/u8data.rs b/shared/src/types/u8data.rs similarity index 97% rename from src/types/u8data.rs rename to shared/src/types/u8data.rs index a89db68..df03c47 100644 --- a/src/types/u8data.rs +++ b/shared/src/types/u8data.rs @@ -2,4 +2,4 @@ pub struct U8Data { pub offset: u32, pub count: u32, -} \ No newline at end of file +} diff --git a/shared/src/utils.rs b/shared/src/utils.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/shared/src/utils.rs @@ -0,0 +1 @@ + diff --git a/src/common/utils.rs b/src/common/utils.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index fe8ac89..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod types; -mod server; -mod common; -mod worker; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index e7a11a9..0000000 --- a/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -} diff --git a/src/server/handler.rs b/src/server/handler.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/server/image.rs b/src/server/image.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/worker/calculations.rs b/src/worker/calculations.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/worker/client.rs b/src/worker/client.rs deleted file mode 100644 index e69de29..0000000