mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 21:13:02 +00:00
WIP
This commit is contained in:
parent
8fc12b0bf0
commit
46019f8537
4 changed files with 98 additions and 0 deletions
11
Cargo.lock
generated
11
Cargo.lock
generated
|
@ -4451,6 +4451,17 @@ dependencies = [
|
||||||
"librocksdb-sys",
|
"librocksdb-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "room"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"client",
|
||||||
|
"gpui",
|
||||||
|
"project",
|
||||||
|
"workspace",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "roxmltree"
|
name = "roxmltree"
|
||||||
version = "0.14.1"
|
version = "0.14.1"
|
||||||
|
|
27
crates/room/Cargo.toml
Normal file
27
crates/room/Cargo.toml
Normal 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"] }
|
15
crates/room/src/participant.rs
Normal file
15
crates/room/src/participant.rs
Normal 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
45
crates/room/src/room.rs
Normal 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!()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue