aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/errors.rs
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2021-05-12 20:16:56 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2021-05-15 22:14:34 +0530
commitc5675e965b9edede26cd26f4658c01ae29b7f2cb (patch)
treec298a01bc12b6e69e9285784024406a8daef6926 /src/common/errors.rs
parentFix memory overflow error and add panic hook for server (diff)
downloadsl0ppij-c5675e965b9edede26cd26f4658c01ae29b7f2cb.tar.gz
sl0ppij-c5675e965b9edede26cd26f4658c01ae29b7f2cb.tar.xz
sl0ppij-c5675e965b9edede26cd26f4658c01ae29b7f2cb.zip
Use ClientToServerMsg and ServerToClientMsg for IPC
Diffstat (limited to 'src/common/errors.rs')
-rw-r--r--src/common/errors.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/errors.rs b/src/common/errors.rs
index c92b9b7f..262dfd6b 100644
--- a/src/common/errors.rs
+++ b/src/common/errors.rs
@@ -120,6 +120,11 @@ impl ErrorContext {
break;
}
}
+ self.update_thread_ctx()
+ }
+
+ /// Updates the thread local [`ErrorContext`].
+ pub fn update_thread_ctx(&self) {
ASYNCOPENCALLS
.try_with(|ctx| *ctx.borrow_mut() = *self)
.unwrap_or_else(|_| OPENCALLS.with(|ctx| *ctx.borrow_mut() = *self));
@@ -369,9 +374,7 @@ impl From<&ClientInstruction> for ClientContext {
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub enum ServerContext {
NewClient,
- Action,
Render,
- TerminalResize,
UnblockInputThread,
ClientExit,
Error,
@@ -381,8 +384,6 @@ impl From<&ServerInstruction> for ServerContext {
fn from(server_instruction: &ServerInstruction) -> Self {
match *server_instruction {
ServerInstruction::NewClient(..) => ServerContext::NewClient,
- ServerInstruction::Action(_) => ServerContext::Action,
- ServerInstruction::TerminalResize(_) => ServerContext::TerminalResize,
ServerInstruction::Render(_) => ServerContext::Render,
ServerInstruction::UnblockInputThread => ServerContext::UnblockInputThread,
ServerInstruction::ClientExit => ServerContext::ClientExit,