BitwiseIp.Mask.parse-exclamation-mark
You're seeing just the function
parse-exclamation-mark
, go back to BitwiseIp.Mask module for more information.
Specs
An error-raising variant of parse/2
.
Given the protocol (either :v4
or :v6
) and the string representation of a
prefix length (without the leading slash), this function looks up the
corresponding bitmask. If the string cannot be parsed, it raises an
ArgumentError
.
Examples
iex> BitwiseIp.Mask.parse!(:v4, "12")
4293918720
iex> BitwiseIp.Mask.parse!(:v6, "12")
340199290171201906221318119490500689920
iex> BitwiseIp.Mask.parse!(:v4, "128")
** (ArgumentError) Invalid IPv4 mask "128"
iex> BitwiseIp.Mask.parse!(:v6, "not a mask")
** (ArgumentError) Invalid IPv6 mask "not a mask"