fn ipv4_netmask_from(length: u8) -> Ipv4Addr {
    let mask = match length {
        len if len <= 32 => u32::max_value().checked_shl(32 - len as u32).unwrap_or(0),
        _ /* invalid value */ => u32::max_value(),
    };
    Ipv4Addr::from(mask)
}
/// Generate an IPv4 netmask from a prefix length (Rust equivalent of ConvertLengthToIpv4Mask())
Generate an IPv4 netmask from a prefix length (Rust equivalent of ConvertLengthToIpv4Mask())
Generate an IPv4 netmask from a prefix length ( Rust equivalent of ConvertLengthToIpv4Mask () )
fn ipv4_netmask_from(length: u8) -> Ipv4Addr {
    let mask = match length {
        len if len <= 32 => u32::max_value().checked_shl(32 - len as u32).unwrap_or(0),
        _ /* invalid value */ => u32::max_value(),
    };
    Ipv4Addr::from(mask)
}
fn ipv4_netmask_from ( length : u8 ) -> Ipv4Addr { let mask = match length { len if len <= 32 => u32 :: max_value ( ) . checked_shl ( 32 - len as u32 ) . unwrap_or ( 0 ) , _ /* invalid value */ => u32 :: max_value ( ) , } ; Ipv4Addr :: from ( mask ) }
Generate an IPv4 netmask from a prefix length (Rust equivalent of ConvertLengthToIpv4Mask())
Generate an IPv4 netmask from a prefix length ( Rust equivalent of ConvertLengthToIpv4Mask () )
length
u8
length
u8