aboutsummaryrefslogtreecommitdiffstats
path: root/teleterm-web/src/protocol.rs
blob: d69618fdddf06fe526fe165ed576b4c3908f80ad (plain) (blame)
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
35
36
37
38
// it's possible we should just consider pulling the real protocol out into a
// crate or something? but ideally in a way that doesn't require pulling in
// tokio

#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, serde::Deserialize)]
pub enum AuthType {
    Plain,
    RecurseCenter,
}

#[derive(Clone, Debug, serde::Deserialize)]
pub(crate) enum Message {
    TerminalOutput { data: Vec<u8> },
    Disconnected,
    Resize { size: Size },
}

#[derive(Clone, Debug, serde::Deserialize)]
pub(crate) struct Session {
    pub id: String,
    pub username: String,
    pub term_type: String,
    pub size: Size,
    pub idle_time: u32,
    pub title: String,
    pub watchers: u32,
}

#[derive(Clone, Debug, serde::Deserialize)]
pub(crate) struct Size {
    pub rows: u16,
    pub cols: u16,
}

#[derive(Clone, Debug, serde::Deserialize)]
pub(crate) struct LoginResponse {
    pub username: String,
}