pub struct AliasRule {
pub prefix: [u8; 16],
pub prefix_len: u8,
pub v4_bit_offset: u8,
}Expand description
IPv6 -> IPv4 alias delegation rule (Section 4).
Fields§
§prefix: [u8; 16]Big-endian network prefix bytes.
prefix_len: u8Number of leading bits to compare (0..=128).
v4_bit_offset: u8Bit offset of the embedded 32-bit IPv4 address (0..=96).
Implementations§
Source§impl AliasRule
impl AliasRule
Sourcepub fn match_ipv6(&self, ip_be: u128) -> Option<u32>
pub fn match_ipv6(&self, ip_be: u128) -> Option<u32>
Test whether ip_be (u128::from_be_bytes(ipv6.octets())) matches this alias rule,
returning the extracted big-endian numeric IPv4 (u32) on match.
pub fn encode(&self, out: &mut Vec<u8>)
pub fn decode(c: &mut Cursor<'_>) -> Result<Self, FormatError>
Trait Implementations§
impl Copy for AliasRule
impl Eq for AliasRule
impl StructuralPartialEq for AliasRule
Auto Trait Implementations§
impl Forget for AliasRule
impl Freeze for AliasRule
impl Move for AliasRule
impl RefUnwindSafe for AliasRule
impl Send for AliasRule
impl Sync for AliasRule
impl Unpin for AliasRule
impl UnsafeUnpin for AliasRule
impl UnwindSafe for AliasRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more