1 |
use semver::Version;
|
2 |
use serde::{Deserialize, Serialize};
|
3 |
|
4 |
use crate::model::instance::Instance;
|
5 |
|
6 |
|
7 |
#[derive(Clone, Serialize, Deserialize)]
|
8 |
pub struct InitiateHandshake {
|
9 |
pub version: Version,
|
10 |
}
|
11 |
|
12 |
|
13 |
#[derive(Clone, Serialize, Deserialize)]
|
14 |
pub struct HandshakeResponse {
|
15 |
pub identity: Instance,
|
16 |
pub version: Version,
|
17 |
}
|
18 |
|
19 |
#[derive(Clone, Serialize, Deserialize)]
|
20 |
pub struct HandshakeFinalize {
|
21 |
pub success: bool,
|
22 |
}
|
23 |
|
24 |
#[derive(Clone, Serialize, Deserialize)]
|
25 |
pub enum HandshakeMessage {
|
26 |
Initiate(InitiateHandshake),
|
27 |
Response(HandshakeResponse),
|
28 |
Finalize(HandshakeFinalize),
|
29 |
}
|
30 |
|