1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
pub trait Unspecified: Sized {
fn is_unspecified(&self) -> bool;
fn filter_unspecified(self) -> Option<Self> {
if self.is_unspecified() {
None
} else {
Some(self)
}
}
}
macro_rules! unspecified_integer {
($name:ident) => {
impl Unspecified for s2n_codec::zerocopy::$name {
fn is_unspecified(&self) -> bool {
Self::default().eq(self)
}
}
};
}
unspecified_integer!(U16);
unspecified_integer!(U32);
unspecified_integer!(U64);
unspecified_integer!(U128);