use derive_deref::Deref; #[derive(Debug, Deref, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct Vout(u32); impl Vout { const ZERO: Self = Vout(0_u32); pub fn is_zero(&self) -> bool { *self == Self::ZERO } } impl From for Vout { fn from(value: u32) -> Self { Self(value) } } impl From for Vout { fn from(value: usize) -> Self { Self(value as u32) } } impl From for u64 { fn from(value: Vout) -> Self { value.0 as u64 } }