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

ambee/giterated

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

Handshake

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨e3e5bf5

⁨src/handshake.rs⁩ - ⁨730⁩ bytes
Raw
1 use semver::Version;
2 use serde::{Deserialize, Serialize};
3
4 use crate::model::instance::Instance;
5
6 /// Sent by the initiator of a new inter-daemon connection.
7 #[derive(Clone, Serialize, Deserialize)]
8 pub struct InitiateHandshake {
9 pub identity: Instance,
10 pub version: Version,
11 }
12
13 /// Sent in response to [`InitiateHandshake`]
14 #[derive(Clone, Serialize, Deserialize)]
15 pub struct HandshakeResponse {
16 pub identity: Instance,
17 pub version: Version,
18 }
19
20 #[derive(Clone, Serialize, Deserialize)]
21 pub struct HandshakeFinalize {
22 pub success: bool,
23 }
24
25 #[derive(Clone, Serialize, Deserialize)]
26 pub enum HandshakeMessage {
27 Initiate(InitiateHandshake),
28 Response(HandshakeResponse),
29 Finalize(HandshakeFinalize),
30 }
31