Simulate request/responses and room broadcasts with random network delay

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-07-18 18:33:08 +02:00
parent 5267c6d2cb
commit 00b0189660
7 changed files with 220 additions and 60 deletions

View file

@ -1,27 +1,18 @@
use crate::{Message, RepoId, Request, RoomCredentials};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
#[derive(Clone, Serialize, Deserialize)]
pub struct PublishRepo {
pub id: RepoId,
pub name: Arc<str>,
}
impl Message for PublishRepo {
fn to_bytes(&self) -> Vec<u8> {
todo!()
}
}
impl Request for PublishRepo {
type Response = PublishRepoResponse;
}
#[derive(Clone, Serialize, Deserialize)]
pub struct PublishRepoResponse {
pub credentials: RoomCredentials,
}
impl Message for PublishRepoResponse {
fn to_bytes(&self) -> Vec<u8> {
todo!()
}
}