use std::fmt::Display;
use serde::{Deserialize, Serialize};
#[derive(Debug, Eq, PartialEq, Clone, Copy, Ord, PartialOrd, Serialize, Deserialize)]
#[repr(transparent)]
#[serde(transparent)]
pub struct NetworkVersion(u32);
impl NetworkVersion {
pub const V0: Self = Self(0);
pub const V1: Self = Self(1);
pub const V2: Self = Self(2);
pub const V3: Self = Self(3);
pub const V4: Self = Self(4);
pub const V5: Self = Self(5);
pub const V6: Self = Self(6);
pub const V7: Self = Self(7);
pub const V8: Self = Self(8);
pub const V9: Self = Self(9);
pub const V10: Self = Self(10);
pub const V11: Self = Self(11);
pub const V12: Self = Self(12);
pub const V13: Self = Self(13);
pub const V14: Self = Self(14);
pub const V15: Self = Self(15);
pub const V16: Self = Self(16);
pub const V17: Self = Self(17);
pub const V18: Self = Self(18);
pub const V19: Self = Self(19);
pub const V20: Self = Self(20);
pub const V21: Self = Self(21);
pub const V22: Self = Self(22);
pub const V23: Self = Self(23);
pub const V24: Self = Self(24);
pub const V25: Self = Self(25);
pub const V26: Self = Self(26);
pub const V27: Self = Self(27);
pub const V28: Self = Self(28);
pub const V29: Self = Self(29);
pub const MAX: Self = Self(u32::MAX);
pub const fn new(v: u32) -> Self {
Self(v)
}
}
impl Display for NetworkVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl From<u32> for NetworkVersion {
fn from(v: u32) -> Self {
Self(v)
}
}
impl From<NetworkVersion> for u32 {
fn from(v: NetworkVersion) -> Self {
v.0
}
}