com.comcast.ip4s
package com.comcast.ip4s
Type members
Classlikes
final case class AnySourceMulticastJoin[+A <: IpAddress](group: Multicast[A]) extends MulticastJoin[A]
Multicast join to a group without a source filter.
- Companion
- object
Classless Inter-Domain Routing address, which represents an IP address and its routing prefix.
- Value Params
- address
-
IP address for which this CIDR refers to
- prefixBits
-
number of leading 1s in the routing mask
- Companion
- object
RFC1123 compliant hostname.
A hostname contains one or more labels, where each label consists of letters A-Z, a-z, digits 0-9, or a dash.
A label may not start or end in a dash and may not exceed 63 characters in length. Labels are separated by
periods and the overall hostname must not exceed 253 characters in length.
A label may not start or end in a dash and may not exceed 63 characters in length. Labels are separated by
periods and the overall hostname must not exceed 253 characters in length.
- Companion
- object
Internationalized domain name, as specified by RFC3490 and RFC5891.
This type models internationalized hostnames. An IDN provides unicode labels, a unicode string form,
and an ASCII hostname form.
and an ASCII hostname form.
A well formed IDN consists of one or more labels separated by dots. Each label may contain unicode characters
as long as the converted ASCII form meets the requirements of RFC1123 (e.g., 63 or fewer characters and no
leading or trailing dash). A dot is represented as an ASCII period or one of the unicode dots: full stop,
ideographic full stop, fullwidth full stop, halfwidth ideographic full stop.
as long as the converted ASCII form meets the requirements of RFC1123 (e.g., 63 or fewer characters and no
leading or trailing dash). A dot is represented as an ASCII period or one of the unicode dots: full stop,
ideographic full stop, fullwidth full stop, halfwidth ideographic full stop.
The
normalize the IDN -- converting all dots to an ASCII period and converting all labels to lowercase.
toString
method returns the IDN in the form in which it was constructed. Sometimes it is useful tonormalize the IDN -- converting all dots to an ASCII period and converting all labels to lowercase.
Note: equality and comparison of IDNs is case-sensitive. Consider comparing normalized toString values
for a more lenient notion of equality.
for a more lenient notion of equality.
- Companion
- object
Immutable and safe representation of an IP address, either V4 or V6.
=== Construction ===
IpAddress
instances are constructed in a few different ways:- via
IpAddress("127.0.0.1")
, which parses a string representation of the IP and returns an Option[IpAddress]
- via
IpAddress.fromBytes(arr)
, which returns an IP address if the supplied array is either exactly 4 bytes or exactly 16 bytes- via literal syntax like
ip"127.0.0.1"
, which returns an IpAddress
and fails to compile if the IP is invalid.=== Type Hierarchy ===
There are two subtypes of
API than
It is safe to pattern match on
IpAddress
-- Ipv4Address and Ipv6Address. Each of these subtypes have a richerAPI than
IpAddress
and 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 on
IpAddress
to access Ipv4Address
or Ipv6Address
directly, or alternatively, you can use fold.=== JVM Specific API ===
If using
with networking libraries. This method does not exist on the Scala.js version.
IpAddress
on the JVM, you can call toInetAddress
to convert the address to a java.net.InetAddress
, for usewith networking libraries. This method does not exist on the Scala.js version.
- Companion
- object
Witness that the wrapped address of type
A
is a multicast address.An instance of
the
Multicast
is typically created by either calling Multicast.apply
or by usingthe
asMulticast
method on IpAddress
.- Companion
- object
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.
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.
- Companion
- object
final case class MulticastSocketAddress[J <: ([x <: IpAddress] =>> MulticastJoin[x]), +A <: IpAddress](join: J[A], port: Port)
A multicast join of the specified type and a port number. Used to describe UDP join of a multicast group.
- Companion
- object
An IP address of the specified type and a port number. Used to describe the source or destination of a socket.
- Companion
- object
Witnesses that the wrapped address of type
A
is a source specific multicast address.An instance of
or by using the
SourceSpecificMulticast
is typically created by either calling Multicast.apply
or by using the
asSourceSpecificMulticast
method on IpAddress
.- Companion
- object
final case class SourceSpecificMulticastJoin[+A <: IpAddress](source: A, group: SourceSpecificMulticast[A]) extends MulticastJoin[A]
Multicast join to a group from the specified source.
- Companion
- object
Extensions
Extensions
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)
extension (ctx: StringContext)