Re-send pending messages after reconnecting

This commit is contained in:
Antonio Scandurra
2021-09-16 16:23:43 +02:00
parent 4a96a5c9ff
commit 8973e250ca
8 changed files with 211 additions and 43 deletions
+19
View File
@@ -248,3 +248,22 @@ impl From<SystemTime> for Timestamp {
}
}
}
impl From<u128> for Nonce {
fn from(nonce: u128) -> Self {
let upper_half = (nonce >> 64) as u64;
let lower_half = nonce as u64;
Self {
upper_half,
lower_half,
}
}
}
impl From<Nonce> for u128 {
fn from(nonce: Nonce) -> Self {
let upper_half = (nonce.upper_half as u128) << 64;
let lower_half = nonce.lower_half as u128;
upper_half | lower_half
}
}