Function is_in_prefix

Source
pub fn is_in_prefix(address: &str, prefix: &IpNetwork) -> bool
Expand description

Checks if the given address is in the given prefix.

§Arguments

  • ‘address’ - the address to check

  • ‘prefix’ - the prefix to check against

§Returns

True if the address is in the prefix, false otherwise.

§Panics

If the address is not a valid IP address.

If the prefix is not a valid prefix.