{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
module Ouroboros.Network.ConnectionId where
import NoThunks.Class (InspectHeap (..), NoThunks)
import Data.Hashable
import GHC.Generics (Generic)
data ConnectionId addr = ConnectionId {
ConnectionId addr -> addr
localAddress :: !addr,
ConnectionId addr -> addr
remoteAddress :: !addr
}
deriving (ConnectionId addr -> ConnectionId addr -> Bool
(ConnectionId addr -> ConnectionId addr -> Bool)
-> (ConnectionId addr -> ConnectionId addr -> Bool)
-> Eq (ConnectionId addr)
forall addr.
Eq addr =>
ConnectionId addr -> ConnectionId addr -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectionId addr -> ConnectionId addr -> Bool
$c/= :: forall addr.
Eq addr =>
ConnectionId addr -> ConnectionId addr -> Bool
== :: ConnectionId addr -> ConnectionId addr -> Bool
$c== :: forall addr.
Eq addr =>
ConnectionId addr -> ConnectionId addr -> Bool
Eq, Eq (ConnectionId addr)
Eq (ConnectionId addr)
-> (ConnectionId addr -> ConnectionId addr -> Ordering)
-> (ConnectionId addr -> ConnectionId addr -> Bool)
-> (ConnectionId addr -> ConnectionId addr -> Bool)
-> (ConnectionId addr -> ConnectionId addr -> Bool)
-> (ConnectionId addr -> ConnectionId addr -> Bool)
-> (ConnectionId addr -> ConnectionId addr -> ConnectionId addr)
-> (ConnectionId addr -> ConnectionId addr -> ConnectionId addr)
-> Ord (ConnectionId addr)
ConnectionId addr -> ConnectionId addr -> Bool
ConnectionId addr -> ConnectionId addr -> Ordering
ConnectionId addr -> ConnectionId addr -> ConnectionId addr
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall addr. Ord addr => Eq (ConnectionId addr)
forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> Bool
forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> Ordering
forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> ConnectionId addr
min :: ConnectionId addr -> ConnectionId addr -> ConnectionId addr
$cmin :: forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> ConnectionId addr
max :: ConnectionId addr -> ConnectionId addr -> ConnectionId addr
$cmax :: forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> ConnectionId addr
>= :: ConnectionId addr -> ConnectionId addr -> Bool
$c>= :: forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> Bool
> :: ConnectionId addr -> ConnectionId addr -> Bool
$c> :: forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> Bool
<= :: ConnectionId addr -> ConnectionId addr -> Bool
$c<= :: forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> Bool
< :: ConnectionId addr -> ConnectionId addr -> Bool
$c< :: forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> Bool
compare :: ConnectionId addr -> ConnectionId addr -> Ordering
$ccompare :: forall addr.
Ord addr =>
ConnectionId addr -> ConnectionId addr -> Ordering
$cp1Ord :: forall addr. Ord addr => Eq (ConnectionId addr)
Ord, Int -> ConnectionId addr -> ShowS
[ConnectionId addr] -> ShowS
ConnectionId addr -> String
(Int -> ConnectionId addr -> ShowS)
-> (ConnectionId addr -> String)
-> ([ConnectionId addr] -> ShowS)
-> Show (ConnectionId addr)
forall addr. Show addr => Int -> ConnectionId addr -> ShowS
forall addr. Show addr => [ConnectionId addr] -> ShowS
forall addr. Show addr => ConnectionId addr -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectionId addr] -> ShowS
$cshowList :: forall addr. Show addr => [ConnectionId addr] -> ShowS
show :: ConnectionId addr -> String
$cshow :: forall addr. Show addr => ConnectionId addr -> String
showsPrec :: Int -> ConnectionId addr -> ShowS
$cshowsPrec :: forall addr. Show addr => Int -> ConnectionId addr -> ShowS
Show, (forall x. ConnectionId addr -> Rep (ConnectionId addr) x)
-> (forall x. Rep (ConnectionId addr) x -> ConnectionId addr)
-> Generic (ConnectionId addr)
forall x. Rep (ConnectionId addr) x -> ConnectionId addr
forall x. ConnectionId addr -> Rep (ConnectionId addr) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall addr x. Rep (ConnectionId addr) x -> ConnectionId addr
forall addr x. ConnectionId addr -> Rep (ConnectionId addr) x
$cto :: forall addr x. Rep (ConnectionId addr) x -> ConnectionId addr
$cfrom :: forall addr x. ConnectionId addr -> Rep (ConnectionId addr) x
Generic)
deriving Context -> ConnectionId addr -> IO (Maybe ThunkInfo)
Proxy (ConnectionId addr) -> String
(Context -> ConnectionId addr -> IO (Maybe ThunkInfo))
-> (Context -> ConnectionId addr -> IO (Maybe ThunkInfo))
-> (Proxy (ConnectionId addr) -> String)
-> NoThunks (ConnectionId addr)
forall addr.
Typeable addr =>
Context -> ConnectionId addr -> IO (Maybe ThunkInfo)
forall addr. Typeable addr => Proxy (ConnectionId addr) -> String
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
showTypeOf :: Proxy (ConnectionId addr) -> String
$cshowTypeOf :: forall addr. Typeable addr => Proxy (ConnectionId addr) -> String
wNoThunks :: Context -> ConnectionId addr -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall addr.
Typeable addr =>
Context -> ConnectionId addr -> IO (Maybe ThunkInfo)
noThunks :: Context -> ConnectionId addr -> IO (Maybe ThunkInfo)
$cnoThunks :: forall addr.
Typeable addr =>
Context -> ConnectionId addr -> IO (Maybe ThunkInfo)
NoThunks via InspectHeap (ConnectionId addr)
instance Hashable a => Hashable (ConnectionId a)