-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Phillip W.
committed
Nov 15, 2023
1 parent
111a1c5
commit ba52c23
Showing
10 changed files
with
367 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
use crate::NetworkInterface; | ||
use crate::{DefaultSerialization, RemoteMessage}; | ||
use actix::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
use std::collections::HashSet; | ||
use std::net::SocketAddr; | ||
use actix::prelude::*; | ||
use crate::NetworkInterface; | ||
use serde::{Serialize, Deserialize}; | ||
use crate::{RemoteMessage, DefaultSerialization}; | ||
|
||
|
||
#[derive(Message)] | ||
#[rtype(result = "Result<Vec<Addr<NetworkInterface>>, ()>")] | ||
pub struct NodeResolving{ | ||
pub addrs: Vec<SocketAddr> | ||
pub struct NodeResolving { | ||
pub addrs: Vec<SocketAddr>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug)] | ||
pub enum GossipEvent { | ||
Join, | ||
Leave | ||
Leave, | ||
} | ||
|
||
#[derive(RemoteMessage, Serialize, Deserialize, Debug, Clone)] | ||
pub struct GossipMessage { | ||
pub event: GossipEvent, | ||
pub addr: SocketAddr, | ||
pub seen: HashSet<SocketAddr> | ||
pub seen: HashSet<SocketAddr>, | ||
} | ||
|
||
#[derive(RemoteMessage, Serialize, Deserialize, Debug, Clone)] | ||
pub struct GossipJoining { | ||
pub about_to_join: usize | ||
pub about_to_join: usize, | ||
} |
Oops, something went wrong.