package ip4s
- Source
- package.scala
- Alphabetic
- By Inheritance
- ip4s
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
AnySourceMulticastJoin[+A <: IpAddress](group: Multicast[A]) extends MulticastJoin[A] with Product with Serializable
Multicast join to a group without a source filter.
-
final
case class
Cidr[+A <: IpAddress] extends Product with Serializable
Classless Inter-Domain Routing address, which represents an IP address and its routing prefix.
-
sealed abstract
class
IpAddress extends IpAddressPlatform with Serializable
Immutable and safe representation of an IP address, either V4 or V6.
Immutable and safe representation of an IP address, either V4 or V6.
Construction
IpAddressinstances are constructed in a few different ways: - viaIpAddress("127.0.0.1"), which parses a string representation of the IP and returns anOption[IpAddress]- viaIpAddress.fromBytes(arr), which returns an IP address if the supplied array is either exactly 4 bytes or exactly 16 bytes - via literal syntax likeip"127.0.0.1", which returns anIpAddressand fails to *compile* if the IP is invalid.Type Hierarchy
There are two subtypes of
IpAddress-- Ipv4Address and Ipv6Address. Each of these subtypes have a richer API thanIpAddressand it is often useful to use those types directly, for example if your use case requires a V6 address. It is safe to pattern match onIpAddressto accessIpv4AddressorIpv6Addressdirectly, or alternatively, you can use fold.JVM Specific API
If using
IpAddresson the JVM, you can calltoInetAddressto convert the address to ajava.net.InetAddress, for use with networking libraries. This method does not exist on the Scala.js version. - implicit final class IpLiteralSyntax extends AnyVal
-
final
class
Ipv4Address extends IpAddress with Ipv4AddressPlatform
Representation of an IPv4 address that works on both the JVM and Scala.js.
-
final
class
Ipv6Address extends IpAddress with Ipv6AddressPlatform
Representation of an IPv6 address that works on both the JVM and Scala.js.
-
sealed
trait
Multicast[+A <: IpAddress] extends Product with Serializable
Witness that the wrapped address of type
Ais a multicast address.Witness that the wrapped address of type
Ais a multicast address.An instance of
Multicastis typically created by either callingMulticast.applyor by using theasMulticastmethod onIpAddress. -
sealed abstract
class
MulticastJoin[+A <: IpAddress] extends Product with Serializable
Represents a join of a multicast group.
Represents a join of a multicast group.
This is represented as an ADT consisting of two constructors, AnySourceMulticastJoin and SourceSpecificMulticastJoin. These constructors are provided as top level types to allow domain modeling where a specific join type is required. The address type is parameterized for a similar reason -- to allow domain modeling where a specific address type is required.
-
final
case class
MulticastSocketAddress[J[+x <: IpAddress] <: MulticastJoin[x], +A <: IpAddress](join: J[A], port: Port) extends Product with Serializable
A multicast join of the specified type and a port number.
A multicast join of the specified type and a port number. Used to describe UDP join of a multicast group.
-
final
case class
Port extends Ordered[Port] with Product with Serializable
TCP or UDP port number.
-
final
case class
SocketAddress[+A <: IpAddress](ip: A, port: Port) extends SocketAddressPlatform[A] with Product with Serializable
An IP address of the specified type and a port number.
An IP address of the specified type and a port number. Used to describe the source or destination of a socket.
-
sealed
trait
SourceSpecificMulticast[+A <: IpAddress] extends Multicast[A]
Witnesses that the wrapped address of type
Ais a source specific multicast address.Witnesses that the wrapped address of type
Ais a source specific multicast address.An instance of
SourceSpecificMulticastis typically created by either callingMulticast.applyor by using theasSourceSpecificMulticastmethod onIpAddress. -
final
case class
SourceSpecificMulticastJoin[+A <: IpAddress](source: A, group: SourceSpecificMulticast[A]) extends MulticastJoin[A] with Product with Serializable
Multicast join to a group from the specified source.
Value Members
- object Cidr extends Serializable
- object IpAddress extends Serializable
- object Ipv4Address extends Serializable
- object Ipv6Address extends Serializable
-
object
LiteralSyntaxMacros
Macros that support literal string interpolators.
- object Multicast extends Serializable
- object MulticastJoin extends Serializable
- object MulticastSocketAddress extends Serializable
- object Port extends Serializable
- object SocketAddress extends Serializable
- object SourceSpecificMulticast extends Serializable