Store shared buffers on LocalWorktree

It's okay for our domain objects to model remote state. We should minimize what we need to store in the rpc::ClientState struct.
This commit is contained in:
Nathan Sobo
2021-06-29 21:01:43 -06:00
parent bbf803d7dc
commit 0fde7a55ef
3 changed files with 106 additions and 78 deletions
+8 -1
View File
@@ -51,11 +51,18 @@ pub struct Receipt<T> {
pub struct TypedEnvelope<T> {
pub sender_id: ConnectionId,
pub original_sender_id: Option<PeerId>,
original_sender_id: Option<PeerId>,
pub message_id: u32,
pub payload: T,
}
impl<T> TypedEnvelope<T> {
pub fn original_sender_id(&self) -> Result<PeerId> {
self.original_sender_id
.ok_or_else(|| anyhow!("missing original_sender_id"))
}
}
impl<T: RequestMessage> TypedEnvelope<T> {
pub fn receipt(&self) -> Receipt<T> {
Receipt {