Noticed today that NetSlice::ip_payload_ref() returns Option<&IpPayloadSlice<'a>> but can't really figure out the reason why because it seems that both IPv4/6 have payload. Is it some smart trick or a genuine omission?
impl<'a> NetSlice<'a> {
/// Returns a reference to ip payload if the net slice contains
/// an ipv4 or ipv6 slice.
#[inline]
pub fn ip_payload_ref(&self) -> Option<&IpPayloadSlice<'a>> {
match self {
NetSlice::Ipv4(s) => Some(&s.payload),
NetSlice::Ipv6(s) => Some(&s.payload),
}
}
}
Hi,
Noticed today that
NetSlice::ip_payload_ref()
returnsOption<&IpPayloadSlice<'a>>
but can't really figure out the reason why because it seems that both IPv4/6 have payload. Is it some smart trick or a genuine omission?