module System.Nix.Store.Remote.Types.Handshake
( ClientHandshakeInput(..)
, ClientHandshakeOutput(..)
, ServerHandshakeInput(..)
, ServerHandshakeOutput(..)
) where
import Data.Text (Text)
import GHC.Generics (Generic)
import System.Nix.Store.Remote.Types.ProtoVersion (ProtoVersion)
import System.Nix.Store.Remote.Types.TrustedFlag (TrustedFlag)
data ClientHandshakeInput = ClientHandshakeInput
{ ClientHandshakeInput -> ProtoVersion
clientHandshakeInputOurVersion :: ProtoVersion
} deriving (ClientHandshakeInput -> ClientHandshakeInput -> Bool
(ClientHandshakeInput -> ClientHandshakeInput -> Bool)
-> (ClientHandshakeInput -> ClientHandshakeInput -> Bool)
-> Eq ClientHandshakeInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
== :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
$c/= :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
/= :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
Eq, (forall x. ClientHandshakeInput -> Rep ClientHandshakeInput x)
-> (forall x. Rep ClientHandshakeInput x -> ClientHandshakeInput)
-> Generic ClientHandshakeInput
forall x. Rep ClientHandshakeInput x -> ClientHandshakeInput
forall x. ClientHandshakeInput -> Rep ClientHandshakeInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ClientHandshakeInput -> Rep ClientHandshakeInput x
from :: forall x. ClientHandshakeInput -> Rep ClientHandshakeInput x
$cto :: forall x. Rep ClientHandshakeInput x -> ClientHandshakeInput
to :: forall x. Rep ClientHandshakeInput x -> ClientHandshakeInput
Generic, Eq ClientHandshakeInput
Eq ClientHandshakeInput =>
(ClientHandshakeInput -> ClientHandshakeInput -> Ordering)
-> (ClientHandshakeInput -> ClientHandshakeInput -> Bool)
-> (ClientHandshakeInput -> ClientHandshakeInput -> Bool)
-> (ClientHandshakeInput -> ClientHandshakeInput -> Bool)
-> (ClientHandshakeInput -> ClientHandshakeInput -> Bool)
-> (ClientHandshakeInput
-> ClientHandshakeInput -> ClientHandshakeInput)
-> (ClientHandshakeInput
-> ClientHandshakeInput -> ClientHandshakeInput)
-> Ord ClientHandshakeInput
ClientHandshakeInput -> ClientHandshakeInput -> Bool
ClientHandshakeInput -> ClientHandshakeInput -> Ordering
ClientHandshakeInput
-> ClientHandshakeInput -> ClientHandshakeInput
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
$ccompare :: ClientHandshakeInput -> ClientHandshakeInput -> Ordering
compare :: ClientHandshakeInput -> ClientHandshakeInput -> Ordering
$c< :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
< :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
$c<= :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
<= :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
$c> :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
> :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
$c>= :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
>= :: ClientHandshakeInput -> ClientHandshakeInput -> Bool
$cmax :: ClientHandshakeInput
-> ClientHandshakeInput -> ClientHandshakeInput
max :: ClientHandshakeInput
-> ClientHandshakeInput -> ClientHandshakeInput
$cmin :: ClientHandshakeInput
-> ClientHandshakeInput -> ClientHandshakeInput
min :: ClientHandshakeInput
-> ClientHandshakeInput -> ClientHandshakeInput
Ord, Int -> ClientHandshakeInput -> ShowS
[ClientHandshakeInput] -> ShowS
ClientHandshakeInput -> String
(Int -> ClientHandshakeInput -> ShowS)
-> (ClientHandshakeInput -> String)
-> ([ClientHandshakeInput] -> ShowS)
-> Show ClientHandshakeInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ClientHandshakeInput -> ShowS
showsPrec :: Int -> ClientHandshakeInput -> ShowS
$cshow :: ClientHandshakeInput -> String
show :: ClientHandshakeInput -> String
$cshowList :: [ClientHandshakeInput] -> ShowS
showList :: [ClientHandshakeInput] -> ShowS
Show)
data ClientHandshakeOutput = ClientHandshakeOutput
{ ClientHandshakeOutput -> Maybe Text
clientHandshakeOutputNixVersion :: Maybe Text
, ClientHandshakeOutput -> Maybe TrustedFlag
clientHandshakeOutputTrust :: Maybe TrustedFlag
, ClientHandshakeOutput -> ProtoVersion
clientHandshakeOutputLeastCommonVersion :: ProtoVersion
, ClientHandshakeOutput -> ProtoVersion
clientHandshakeOutputServerVersion :: ProtoVersion
} deriving (ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
(ClientHandshakeOutput -> ClientHandshakeOutput -> Bool)
-> (ClientHandshakeOutput -> ClientHandshakeOutput -> Bool)
-> Eq ClientHandshakeOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
== :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
$c/= :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
/= :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
Eq, (forall x. ClientHandshakeOutput -> Rep ClientHandshakeOutput x)
-> (forall x. Rep ClientHandshakeOutput x -> ClientHandshakeOutput)
-> Generic ClientHandshakeOutput
forall x. Rep ClientHandshakeOutput x -> ClientHandshakeOutput
forall x. ClientHandshakeOutput -> Rep ClientHandshakeOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ClientHandshakeOutput -> Rep ClientHandshakeOutput x
from :: forall x. ClientHandshakeOutput -> Rep ClientHandshakeOutput x
$cto :: forall x. Rep ClientHandshakeOutput x -> ClientHandshakeOutput
to :: forall x. Rep ClientHandshakeOutput x -> ClientHandshakeOutput
Generic, Eq ClientHandshakeOutput
Eq ClientHandshakeOutput =>
(ClientHandshakeOutput -> ClientHandshakeOutput -> Ordering)
-> (ClientHandshakeOutput -> ClientHandshakeOutput -> Bool)
-> (ClientHandshakeOutput -> ClientHandshakeOutput -> Bool)
-> (ClientHandshakeOutput -> ClientHandshakeOutput -> Bool)
-> (ClientHandshakeOutput -> ClientHandshakeOutput -> Bool)
-> (ClientHandshakeOutput
-> ClientHandshakeOutput -> ClientHandshakeOutput)
-> (ClientHandshakeOutput
-> ClientHandshakeOutput -> ClientHandshakeOutput)
-> Ord ClientHandshakeOutput
ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
ClientHandshakeOutput -> ClientHandshakeOutput -> Ordering
ClientHandshakeOutput
-> ClientHandshakeOutput -> ClientHandshakeOutput
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
$ccompare :: ClientHandshakeOutput -> ClientHandshakeOutput -> Ordering
compare :: ClientHandshakeOutput -> ClientHandshakeOutput -> Ordering
$c< :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
< :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
$c<= :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
<= :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
$c> :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
> :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
$c>= :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
>= :: ClientHandshakeOutput -> ClientHandshakeOutput -> Bool
$cmax :: ClientHandshakeOutput
-> ClientHandshakeOutput -> ClientHandshakeOutput
max :: ClientHandshakeOutput
-> ClientHandshakeOutput -> ClientHandshakeOutput
$cmin :: ClientHandshakeOutput
-> ClientHandshakeOutput -> ClientHandshakeOutput
min :: ClientHandshakeOutput
-> ClientHandshakeOutput -> ClientHandshakeOutput
Ord, Int -> ClientHandshakeOutput -> ShowS
[ClientHandshakeOutput] -> ShowS
ClientHandshakeOutput -> String
(Int -> ClientHandshakeOutput -> ShowS)
-> (ClientHandshakeOutput -> String)
-> ([ClientHandshakeOutput] -> ShowS)
-> Show ClientHandshakeOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ClientHandshakeOutput -> ShowS
showsPrec :: Int -> ClientHandshakeOutput -> ShowS
$cshow :: ClientHandshakeOutput -> String
show :: ClientHandshakeOutput -> String
$cshowList :: [ClientHandshakeOutput] -> ShowS
showList :: [ClientHandshakeOutput] -> ShowS
Show)
data ServerHandshakeInput = ServerHandshakeInput
{ ServerHandshakeInput -> Text
serverHandshakeInputNixVersion :: Text
, ServerHandshakeInput -> ProtoVersion
serverHandshakeInputOurVersion :: ProtoVersion
, ServerHandshakeInput -> Maybe TrustedFlag
serverHandshakeInputTrust :: Maybe TrustedFlag
} deriving (ServerHandshakeInput -> ServerHandshakeInput -> Bool
(ServerHandshakeInput -> ServerHandshakeInput -> Bool)
-> (ServerHandshakeInput -> ServerHandshakeInput -> Bool)
-> Eq ServerHandshakeInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
== :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
$c/= :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
/= :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
Eq, (forall x. ServerHandshakeInput -> Rep ServerHandshakeInput x)
-> (forall x. Rep ServerHandshakeInput x -> ServerHandshakeInput)
-> Generic ServerHandshakeInput
forall x. Rep ServerHandshakeInput x -> ServerHandshakeInput
forall x. ServerHandshakeInput -> Rep ServerHandshakeInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ServerHandshakeInput -> Rep ServerHandshakeInput x
from :: forall x. ServerHandshakeInput -> Rep ServerHandshakeInput x
$cto :: forall x. Rep ServerHandshakeInput x -> ServerHandshakeInput
to :: forall x. Rep ServerHandshakeInput x -> ServerHandshakeInput
Generic, Eq ServerHandshakeInput
Eq ServerHandshakeInput =>
(ServerHandshakeInput -> ServerHandshakeInput -> Ordering)
-> (ServerHandshakeInput -> ServerHandshakeInput -> Bool)
-> (ServerHandshakeInput -> ServerHandshakeInput -> Bool)
-> (ServerHandshakeInput -> ServerHandshakeInput -> Bool)
-> (ServerHandshakeInput -> ServerHandshakeInput -> Bool)
-> (ServerHandshakeInput
-> ServerHandshakeInput -> ServerHandshakeInput)
-> (ServerHandshakeInput
-> ServerHandshakeInput -> ServerHandshakeInput)
-> Ord ServerHandshakeInput
ServerHandshakeInput -> ServerHandshakeInput -> Bool
ServerHandshakeInput -> ServerHandshakeInput -> Ordering
ServerHandshakeInput
-> ServerHandshakeInput -> ServerHandshakeInput
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
$ccompare :: ServerHandshakeInput -> ServerHandshakeInput -> Ordering
compare :: ServerHandshakeInput -> ServerHandshakeInput -> Ordering
$c< :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
< :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
$c<= :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
<= :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
$c> :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
> :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
$c>= :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
>= :: ServerHandshakeInput -> ServerHandshakeInput -> Bool
$cmax :: ServerHandshakeInput
-> ServerHandshakeInput -> ServerHandshakeInput
max :: ServerHandshakeInput
-> ServerHandshakeInput -> ServerHandshakeInput
$cmin :: ServerHandshakeInput
-> ServerHandshakeInput -> ServerHandshakeInput
min :: ServerHandshakeInput
-> ServerHandshakeInput -> ServerHandshakeInput
Ord, Int -> ServerHandshakeInput -> ShowS
[ServerHandshakeInput] -> ShowS
ServerHandshakeInput -> String
(Int -> ServerHandshakeInput -> ShowS)
-> (ServerHandshakeInput -> String)
-> ([ServerHandshakeInput] -> ShowS)
-> Show ServerHandshakeInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ServerHandshakeInput -> ShowS
showsPrec :: Int -> ServerHandshakeInput -> ShowS
$cshow :: ServerHandshakeInput -> String
show :: ServerHandshakeInput -> String
$cshowList :: [ServerHandshakeInput] -> ShowS
showList :: [ServerHandshakeInput] -> ShowS
Show)
data ServerHandshakeOutput = ServerHandshakeOutput
{ ServerHandshakeOutput -> ProtoVersion
serverHandshakeOutputLeastCommonVersion :: ProtoVersion
, ServerHandshakeOutput -> ProtoVersion
serverHandshakeOutputClientVersion :: ProtoVersion
} deriving (ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
(ServerHandshakeOutput -> ServerHandshakeOutput -> Bool)
-> (ServerHandshakeOutput -> ServerHandshakeOutput -> Bool)
-> Eq ServerHandshakeOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
== :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
$c/= :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
/= :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
Eq, (forall x. ServerHandshakeOutput -> Rep ServerHandshakeOutput x)
-> (forall x. Rep ServerHandshakeOutput x -> ServerHandshakeOutput)
-> Generic ServerHandshakeOutput
forall x. Rep ServerHandshakeOutput x -> ServerHandshakeOutput
forall x. ServerHandshakeOutput -> Rep ServerHandshakeOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ServerHandshakeOutput -> Rep ServerHandshakeOutput x
from :: forall x. ServerHandshakeOutput -> Rep ServerHandshakeOutput x
$cto :: forall x. Rep ServerHandshakeOutput x -> ServerHandshakeOutput
to :: forall x. Rep ServerHandshakeOutput x -> ServerHandshakeOutput
Generic, Eq ServerHandshakeOutput
Eq ServerHandshakeOutput =>
(ServerHandshakeOutput -> ServerHandshakeOutput -> Ordering)
-> (ServerHandshakeOutput -> ServerHandshakeOutput -> Bool)
-> (ServerHandshakeOutput -> ServerHandshakeOutput -> Bool)
-> (ServerHandshakeOutput -> ServerHandshakeOutput -> Bool)
-> (ServerHandshakeOutput -> ServerHandshakeOutput -> Bool)
-> (ServerHandshakeOutput
-> ServerHandshakeOutput -> ServerHandshakeOutput)
-> (ServerHandshakeOutput
-> ServerHandshakeOutput -> ServerHandshakeOutput)
-> Ord ServerHandshakeOutput
ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
ServerHandshakeOutput -> ServerHandshakeOutput -> Ordering
ServerHandshakeOutput
-> ServerHandshakeOutput -> ServerHandshakeOutput
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
$ccompare :: ServerHandshakeOutput -> ServerHandshakeOutput -> Ordering
compare :: ServerHandshakeOutput -> ServerHandshakeOutput -> Ordering
$c< :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
< :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
$c<= :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
<= :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
$c> :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
> :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
$c>= :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
>= :: ServerHandshakeOutput -> ServerHandshakeOutput -> Bool
$cmax :: ServerHandshakeOutput
-> ServerHandshakeOutput -> ServerHandshakeOutput
max :: ServerHandshakeOutput
-> ServerHandshakeOutput -> ServerHandshakeOutput
$cmin :: ServerHandshakeOutput
-> ServerHandshakeOutput -> ServerHandshakeOutput
min :: ServerHandshakeOutput
-> ServerHandshakeOutput -> ServerHandshakeOutput
Ord, Int -> ServerHandshakeOutput -> ShowS
[ServerHandshakeOutput] -> ShowS
ServerHandshakeOutput -> String
(Int -> ServerHandshakeOutput -> ShowS)
-> (ServerHandshakeOutput -> String)
-> ([ServerHandshakeOutput] -> ShowS)
-> Show ServerHandshakeOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ServerHandshakeOutput -> ShowS
showsPrec :: Int -> ServerHandshakeOutput -> ShowS
$cshow :: ServerHandshakeOutput -> String
show :: ServerHandshakeOutput -> String
$cshowList :: [ServerHandshakeOutput] -> ShowS
showList :: [ServerHandshakeOutput] -> ShowS
Show)