Pfx.drop
You're seeing just the function
drop
, go back to Pfx module for more information.
Specs
drop(prefix(), non_neg_integer()) :: prefix()
Drops count
lsb bits from given pfx
.
If count
exceeds the actual number of bits in pfx
, simply drops all
bits.
Examples
iex> drop("1.2.3.0/31", 1)
"1.2.3.0/30"
iex> drop("1.2.3.2/31", 1)
"1.2.3.0/30"
iex> drop("1.2.3.128/25", 1)
"1.2.3.0/24"
iex> drop("1.1.1.130/31", 1)
"1.1.1.128/30"
# drops all
iex> drop("1.2.3.0/24", 512)
"0.0.0.0/0"
iex> drop("2001:0db8:85a3:0000:0000:8a2e:0370:7334", 64)
"2001:db8:85a3::/64"
iex> drop({1, 2, 3, 4}, 8)
{1, 2, 3, 0}
iex> drop({{1, 2, 3, 4}, 32}, 16)
{{1, 2, 0, 0}, 16}
iex> drop(%Pfx{bits: <<1, 2, 3, 4>>, maxlen: 32}, 16)
%Pfx{bits: <<1, 2>>, maxlen: 32}