diff --git a/Cargo.lock b/Cargo.lock index 925a4323a4..d30cbcee69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4451,6 +4451,17 @@ dependencies = [ "librocksdb-sys", ] +[[package]] +name = "room" +version = "0.1.0" +dependencies = [ + "anyhow", + "client", + "gpui", + "project", + "workspace", +] + [[package]] name = "roxmltree" version = "0.14.1" diff --git a/crates/room/Cargo.toml b/crates/room/Cargo.toml new file mode 100644 index 0000000000..767ba399d6 --- /dev/null +++ b/crates/room/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "room" +version = "0.1.0" +edition = "2021" + +[lib] +path = "src/room.rs" +doctest = false + +[features] +test-support = [ + "client/test-support", + "gpui/test-support", + "project/test-support", +] + +[dependencies] +anyhow = "1.0.38" +client = { path = "../client" } +gpui = { path = "../gpui" } +project = { path = "../project" } +workspace = { path = "../workspace" } + +[dev-dependencies] +client = { path = "../client", features = ["test-support"] } +gpui = { path = "../gpui", features = ["test-support"] } +project = { path = "../project", features = ["test-support"] } diff --git a/crates/room/src/participant.rs b/crates/room/src/participant.rs new file mode 100644 index 0000000000..a5b02b05a6 --- /dev/null +++ b/crates/room/src/participant.rs @@ -0,0 +1,15 @@ +use client::User; +use gpui::{ModelHandle, ViewHandle}; +use project::Project; +use workspace::Workspace; + +pub struct LocalParticipant { + user: User, + workspaces: Vec>, +} + +pub struct RemoteParticipant { + user: User, + workspaces: Vec>, + active_workspace_id: usize, +} diff --git a/crates/room/src/room.rs b/crates/room/src/room.rs new file mode 100644 index 0000000000..b18cb800e4 --- /dev/null +++ b/crates/room/src/room.rs @@ -0,0 +1,45 @@ +mod participant; + +use anyhow::Result; +use client::Client; +use gpui::ModelHandle; +use participant::{LocalParticipant, RemoteParticipant}; +use project::Project; +use std::sync::Arc; + +pub struct Room { + id: u64, + local_participant: LocalParticipant, + remote_participants: Vec, + client: Arc, +} + +impl Room { + pub async fn create(client: Arc) -> Result { + todo!() + } + + pub async fn join(id: u64, client: Arc) -> Result { + todo!() + } + + pub async fn invite(&mut self, user_id: u64) -> Result<()> { + todo!() + } + + pub async fn share(&mut self) -> Result<()> { + todo!() + } + + pub async fn unshare(&mut self) -> Result<()> { + todo!() + } + + pub async fn mute(&mut self) -> Result<()> { + todo!() + } + + pub async fn unmute(&mut self) -> Result<()> { + todo!() + } +}