Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data DomainAccessPoint = DomainAccessPoint {
- dapDomain :: !Domain
- dapPortNumber :: !PortNumber
- data RelayAccessPoint where
- newtype RelayAccessPointCoded = RelayAccessPointCoded {}
- data IP
- data PortNumber
Documentation
data DomainAccessPoint Source #
A product of a Domain
and PortNumber
. After resolving the
domain we will use the PortNumber
to form SockAddr
.
Instances
data RelayAccessPoint Source #
A relay can have either an IP address and a port number or a domain with a port number
pattern RelayDomainAccessPoint :: DomainAccessPoint -> RelayAccessPoint |
|
Instances
newtype RelayAccessPointCoded Source #
Instances
FromJSON RelayAccessPointCoded Source # | |
ToJSON RelayAccessPointCoded Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type toJSON :: RelayAccessPointCoded -> Value # toEncoding :: RelayAccessPointCoded -> Encoding # toJSONList :: [RelayAccessPointCoded] -> Value # toEncodingList :: [RelayAccessPointCoded] -> Encoding # omitField :: RelayAccessPointCoded -> Bool # | |
FromCBOR RelayAccessPointCoded Source # | |
ToCBOR RelayAccessPointCoded Source # | These instances are used to serialize |
Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint toCBOR :: RelayAccessPointCoded -> Encoding # encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy RelayAccessPointCoded -> Size # encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [RelayAccessPointCoded] -> Size # |
A unified IP data for IPv4
and IPv6
.
To create this, use the data constructors. Or use read
"192.0.2.1"
:: IP
, for example. Also, "192.0.2.1"
can be used as literal with OverloadedStrings.
>>>
(read "192.0.2.1" :: IP) == IPv4 (read "192.0.2.1" :: IPv4)
True>>>
(read "2001:db8:00:00:00:00:00:01" :: IP) == IPv6 (read "2001:db8:00:00:00:00:00:01" :: IPv6)
True
Instances
Data IP | |||||
Defined in Data.IP.Addr gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IP -> c IP # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IP # dataTypeOf :: IP -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IP) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IP) # gmapT :: (forall b. Data b => b -> b) -> IP -> IP # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IP -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IP -> r # gmapQ :: (forall d. Data d => d -> u) -> IP -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IP -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IP -> m IP # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IP -> m IP # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IP -> m IP # | |||||
IsString IP | |||||
Defined in Data.IP.Addr fromString :: String -> IP # | |||||
Enum IP | |||||
Generic IP | |||||
Defined in Data.IP.Addr
| |||||
Read IP | |||||
Show IP | |||||
Eq IP | Equality over IP addresses. Correctly compare IPv4 and IPv4-embedded-in-IPv6 addresses.
| ||||
Ord IP | |||||
type Rep IP | |||||
Defined in Data.IP.Addr type Rep IP = D1 ('MetaData "IP" "Data.IP.Addr" "iproute-1.7.15-92c10579ccaa68750f03c4296bb8091921b68020640da951e29e254441683859" 'False) (C1 ('MetaCons "IPv4" 'PrefixI 'True) (S1 ('MetaSel ('Just "ipv4") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedUnpack) (Rec0 IPv4)) :+: C1 ('MetaCons "IPv6" 'PrefixI 'True) (S1 ('MetaSel ('Just "ipv6") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 IPv6))) |
Socket type re-exports
data PortNumber #
Port number.
Use the Num
instance (i.e. use a literal) to create a
PortNumber
value.
>>>
1 :: PortNumber
1>>>
read "1" :: PortNumber
1>>>
show (12345 :: PortNumber)
"12345">>>
50000 < (51000 :: PortNumber)
True>>>
50000 < (52000 :: PortNumber)
True>>>
50000 + (10000 :: PortNumber)
60000