This commit is contained in:
Antonio Scandurra 2022-09-19 18:01:34 +02:00
parent 8fc12b0bf0
commit 46019f8537
4 changed files with 98 additions and 0 deletions

11
Cargo.lock generated
View file

@ -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"

27
crates/room/Cargo.toml Normal file
View file

@ -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"] }

View file

@ -0,0 +1,15 @@
use client::User;
use gpui::{ModelHandle, ViewHandle};
use project::Project;
use workspace::Workspace;
pub struct LocalParticipant {
user: User,
workspaces: Vec<ViewHandle<Workspace>>,
}
pub struct RemoteParticipant {
user: User,
workspaces: Vec<ViewHandle<Workspace>>,
active_workspace_id: usize,
}

45
crates/room/src/room.rs Normal file
View file

@ -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<RemoteParticipant>,
client: Arc<Client>,
}
impl Room {
pub async fn create(client: Arc<Client>) -> Result<u64> {
todo!()
}
pub async fn join(id: u64, client: Arc<Client>) -> Result<Self> {
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!()
}
}