struct IP::Block::IPv6
- IP::Block::IPv6
- IP::Block
- Struct
- Value
- Object
Defined in:
ip/block/ipv6.crConstructors
- .loopback : self
-
.new(address : IP::Address::IPv6, block : Int) : self
Constructs a new
IP::Block::IPv6
from an address and the block size, [0-128]. -
.new(string : String) : self
Constructs a new
IP::Block::IPv6
by interpreting the contents of a givenString
. -
.new?(address : IP::Address::IPv6, block : Int) : self?
Constructs a new
IP::Block::IPv6
from an address and the block size, [0-128]. -
.new?(string : String) : self?
Constructs a new
IP::Block::IPv6
by interpreting the contents of a givenString
.
Instance Method Summary
-
#address : IP::Address::IPv6
Returns the address component of the block which is also the first address.
-
#block : UInt8
Returns 'block' size in the form of 2^x, x being the 'size'.
-
#ipv6? : Bool
Informs if the block is IPv6 or not.
-
#size : UInt128
Returns the size of the block in terms of number of addresses.
Instance methods inherited from struct IP::Block
<(other : IP::Block)
<,
<=(other : IP::Block)
<=,
<=>(other : IP::Block) : Int<=>(other : IP::Address) : Int <=>, ==(other : IP::Block) ==, >(other : IP::Block) >, >=(other : IP::Block) >=, address address, adjacent?(other : IP::Address) : Bool
adjacent?(other : IP::Block) : Bool adjacent?, block block, covers?(other : IP::Address) : Bool
covers?(other : IP::Block) : Bool covers?, each(&block : IP::Address -> Nil) : Nil each, first : IP::Address first, hash(hasher) hash, includes?(other : IP::Address) : Bool includes?, inspect(io : IO) : Nil inspect, intersects?(other : IP::Block) : Bool
intersects?(other : IP::Address) : Bool intersects?, ipv4? : Bool ipv4?, ipv6? : Bool ipv6?, last : IP::Address last, mask : IP::Address mask, single_address? : Bool single_address?, size size, to_s(io : IO) : Nil to_s
Constructor methods inherited from struct IP::Block
[](string : String) : self
[],
[]?(string : String) : self?
[]?,
ipv4(string : String) : self
ipv4,
ipv4?(string : String) : self?
ipv4?,
ipv6(string : String) : self
ipv6,
ipv6?(string : String) : self?
ipv6?,
loopback_ipv4 : self
loopback_ipv4,
loopback_ipv6 : self
loopback_ipv6,
new(address : IP::Address, block : Int) : self?new(string : String) : self new, new?(address : IP::Address, block : Int) : self?
new?(string : String) : self? new?
Constructor Detail
Constructs a new IP::Block::IPv6
from an address and the block size, [0-128].
Raises: MalformedError
when the input is malformed.
Constructs a new IP::Block::IPv6
by interpreting the contents of a given String
.
Expects a definition in CIDR notation similar to XXXX:XXXX::XXXX:XXXX:XXXX/[0-128], or XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX/[0-128].
Raises: MalformedError
when the input is malformed.
Constructs a new IP::Block::IPv6
from an address and the block size, [0-128].
Returns nil
when the input is malformed.
Constructs a new IP::Block::IPv6
by interpreting the contents of a given String
.
Expects a definition in CIDR notation similar to XXXX:XXXX::XXXX:XXXX:XXXX/[0-128], or XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX/[0-128].
Returns nil
when the input is malformed.
Instance Method Detail
Returns the address component of the block which is also the first address.