JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Connection

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨415ff8d

⁨src/handshake.rs⁩ - ⁨707⁩ bytes
Raw
1 use serde::{Deserialize, Serialize};
2
3 use crate::model::instance::Instance;
4
5 /// Sent by the initiator of a new inter-daemon connection.
6 #[derive(Clone, Serialize, Deserialize)]
7 pub struct InitiateHandshake {
8 pub identity: Instance,
9 pub version: String,
10 }
11
12 /// Sent in response to [`InitiateHandshake`]
13 #[derive(Clone, Serialize, Deserialize)]
14 pub struct HandshakeResponse {
15 pub identity: Instance,
16 pub version: String,
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