Some more basic work

This commit is contained in:
Alex Auvolat
2020-04-06 19:55:39 +02:00
parent 7102db1d54
commit 1a5e6e39af
10 changed files with 417 additions and 67 deletions
-23
View File
@@ -1,31 +1,8 @@
use std::net::SocketAddr;
use serde::{Serialize, Deserialize};
pub type UUID = [u8; 32];
pub type Hash = [u8; 32];
// Membership management
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NodeStatus {
id: UUID,
time: u64,
addr: SocketAddr,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NodeConfig {
id: UUID,
n_tokens: u32,
}
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct NetworkMembers {
pings: Vec<NodeStatus>,
desired_state: Vec<NodeConfig>,
desired_state_version: u64,
}
// Data management