Add initial messages for setting up a worktree share

This commit is contained in:
Max Brunsfeld
2021-06-09 18:14:30 -07:00
parent a10f4bb4ff
commit 9c5c9fdc36
2 changed files with 46 additions and 5 deletions
+13 -2
View File
@@ -5,14 +5,25 @@ use std::io;
include!(concat!(env!("OUT_DIR"), "/zed.messages.rs"));
use from_client as client;
use from_server as server;
pub trait Request {
type Response;
}
impl Request for from_client::Auth {
type Response = from_server::Ack;
macro_rules! request_response {
($req:path, $resp:path) => {
impl Request for $req {
type Response = $resp;
}
};
}
request_response!(client::Auth, server::AuthResponse);
request_response!(client::NewWorktree, server::NewWorktreeResponse);
request_response!(client::ShareWorktree, server::ShareWorktreeResponse);
/// A stream of protobuf messages.
pub struct MessageStream<T> {
byte_stream: T,