MscmpSystDb.DbTypes.Inet (mscmp_syst_db v0.1.0)
An Elixir representation of the PostgreSQL inet
and cidr
data types.
Derived from the Postgrex.INET data type. For more information about this data type, see: The PostgreSQL Documentation: Network Address Types
Summary
Functions
Callback implementation for Ecto.Type.embed_as/1
.
Callback implementation for Ecto.Type.equal?/2
.
Converts a network address represented either as a
MscmpSystNetwork.Types.IpV4.t/0
or MscmpSystNetwork.Types.IpV6.t/0
value into one represented as a MscmpSystDb.DbTypes.Inet.t/0
value.
Converts a network address represented as a Postgrex.INET.t/0
value into one represented as a MscmpSystDb.DbTypes.Inet.t/0
value.
Converts a network address represented as a MscmpSystDb.DbTypes.Inet.t/0
value into one represented as either a MscmpSystNetwork.Types.IpV4.t/0
or
MscmpSystNetwork.Types.IpV6.t/0
value.
Converts a network address represented as a MscmpSystDb.DbTypes.Inet.t/0
value into one represented as a Postgrex.INET.t/0
value.
Types
@type t() :: %MscmpSystDb.DbTypes.Inet{ address: :inet.ip_address(), netmask: nil | 0..128 }
Functions
embed_as(_)
Callback implementation for Ecto.Type.embed_as/1
.
equal?(term1, term2)
Callback implementation for Ecto.Type.equal?/2
.
from_net_address(address_or_network)
@spec from_net_address(MscmpSystNetwork.Types.addr_structs()) :: t()
Converts a network address represented either as a
MscmpSystNetwork.Types.IpV4.t/0
or MscmpSystNetwork.Types.IpV6.t/0
value into one represented as a MscmpSystDb.DbTypes.Inet.t/0
value.
from_postgrex_inet(address)
@spec from_postgrex_inet(Postgrex.INET.t()) :: t()
Converts a network address represented as a Postgrex.INET.t/0
value into one represented as a MscmpSystDb.DbTypes.Inet.t/0
value.
to_net_address(address_or_network)
@spec to_net_address(t()) :: MscmpSystNetwork.Types.addr_structs()
Converts a network address represented as a MscmpSystDb.DbTypes.Inet.t/0
value into one represented as either a MscmpSystNetwork.Types.IpV4.t/0
or
MscmpSystNetwork.Types.IpV6.t/0
value.
to_postgrex_inet(address)
@spec to_postgrex_inet(t()) :: Postgrex.INET.t()
Converts a network address represented as a MscmpSystDb.DbTypes.Inet.t/0
value into one represented as a Postgrex.INET.t/0
value.