rateguard-proto 0.1.0
“The wire format of rateguard: SWIM membership and demand reports over UDP”
Package first published within seven daysPackage under two months old
SHA-256441faa764fc8e69b2a65ba338274ff09ea7cb2ae8f70795bbcee040186bce844
MaleculeMd₂(In₄Pa)
Evidence
7:19… EYS`] keys.
8#![warn(missing_docs)]
9
10use serde::{Deserialize, Serialize};
11use std::fmt;
12use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
13
14/// The largest datagram, in bytes: under a typical 1500-byte MTU with room
15/// for IP and UDP headers, so nothing is ever fragmented.
16pub const MAX_DATAGRAM: usize = 1400;
17/// The most …
⋯4 lines
274}
275
276#[cfg(test)]
277mod tests {
278 use super::*;
279
280 fn addr(n: u8) -> Address {
⋯4 lines
⋯4 lines
341 }
342
343 #[test]
344 fn an_address_survives_the_wire_both_ways() {
345 use std::net::SocketAddr;
346 for text in ["10.0.0.7:7946", "[200 …
518:30… _dead_beats_suspect_beats_alive() {
519 use Status::*;
520 assert!(update(4, Suspect).supersedes(&update(4, Alive)));
521 assert!(update(4, D …
621 ),
622 ]
623 }
624
625 proptest! {
626 #[test]
627 fn any_bytes_from_the_network_are_decoded_or_refused_never_a_panic(
628 bytes in prop::collection::vec( …
No evidence locations were recorded for this file. Raw result