BitwiseIp.Blocks.parse-exclamation-mark
You're seeing just the function
parse-exclamation-mark
, go back to BitwiseIp.Blocks module for more information.
Specs
An error-raising variant of parse/1
.
This function takes a list of strings in CIDR notation and parses them into
bitwise IP blocks using BitwiseIp.Block.parse!/1
. If any of the strings are
invalid, the whole list fails to parse and the error is propagated. If you
want to discard invalid elements instead, use parse/1
.
Examples
iex> BitwiseIp.Blocks.parse!(["3.14.0.0/16", "dead::beef"])
...> |> Enum.map(&to_string/1)
["3.14.0.0/16", "dead::beef/128"]
iex> BitwiseIp.Blocks.parse!(["3.14/16", "invalid", "dead::cow"])
** (ArgumentError) Invalid IP address "3.14" in CIDR "3.14/16"
iex> BitwiseIp.Blocks.parse!(["3.14.0.0/16", "invalid", "dead::beef"])
** (ArgumentError) Invalid IP address "invalid" in CIDR "invalid"