-
-
Notifications
You must be signed in to change notification settings - Fork 359
Expand file tree
/
Copy pathevents.rs
More file actions
34 lines (29 loc) · 1000 Bytes
/
events.rs
File metadata and controls
34 lines (29 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use serde::Serialize;
use serde_json::Value;
use crate::types::WorkspaceSymphonyEvent;
#[derive(Serialize, Clone)]
pub(crate) struct AppServerEvent {
pub(crate) workspace_id: String,
pub(crate) message: Value,
}
#[derive(Debug, Serialize, Clone)]
pub(crate) struct TerminalOutput {
#[serde(rename = "workspaceId")]
pub(crate) workspace_id: String,
#[serde(rename = "terminalId")]
pub(crate) terminal_id: String,
pub(crate) data: String,
}
#[derive(Debug, Serialize, Clone)]
pub(crate) struct TerminalExit {
#[serde(rename = "workspaceId")]
pub(crate) workspace_id: String,
#[serde(rename = "terminalId")]
pub(crate) terminal_id: String,
}
pub(crate) trait EventSink: Clone + Send + Sync + 'static {
fn emit_app_server_event(&self, event: AppServerEvent);
fn emit_terminal_output(&self, event: TerminalOutput);
fn emit_terminal_exit(&self, event: TerminalExit);
fn emit_workspace_symphony_event(&self, event: WorkspaceSymphonyEvent);
}