fn ipv6_netmask_from(length: u8) -> Ipv6Addr {
    let mask = match length {
        len if len <= 128 => u128::max_value().checked_shl(128 - len as u32).unwrap_or(0),
        _ /* invalid value */ => u128::max_value(),
    };
    Ipv6Addr::from(mask)
}
/// Generate an IPv6 netmask from a prefix length
Generate an IPv6 netmask from a prefix length
Generate an IPv6 netmask from a prefix length
fn ipv6_netmask_from(length: u8) -> Ipv6Addr {
    let mask = match length {
        len if len <= 128 => u128::max_value().checked_shl(128 - len as u32).unwrap_or(0),
        _ /* invalid value */ => u128::max_value(),
    };
    Ipv6Addr::from(mask)
}
fn ipv6_netmask_from ( length : u8 ) -> Ipv6Addr { let mask = match length { len if len <= 128 => u128 :: max_value ( ) . checked_shl ( 128 - len as u32 ) . unwrap_or ( 0 ) , _ /* invalid value */ => u128 :: max_value ( ) , } ; Ipv6Addr :: from ( mask ) }
Generate an IPv6 netmask from a prefix length
Generate an IPv6 netmask from a prefix length
length
u8
length
u8