use serde::{Deserialize, Serialize}; use crate::model::instance::Instance; /// Sent by the initiator of a new inter-daemon connection. #[derive(Clone, Serialize, Deserialize)] pub struct InitiateHandshake { pub identity: Instance, pub version: String, } /// Sent in response to [`InitiateHandshake`] #[derive(Clone, Serialize, Deserialize)] pub struct HandshakeResponse { pub identity: Instance, pub version: String, } #[derive(Clone, Serialize, Deserialize)] pub struct HandshakeFinalize { pub success: bool, } #[derive(Clone, Serialize, Deserialize)] pub enum HandshakeMessage { Initiate(InitiateHandshake), Response(HandshakeResponse), Finalize(HandshakeFinalize), }