toxcore-0.2.11: A Tox protocol implementation in Haskell
Safe HaskellSafe
LanguageHaskell2010

Network.Tox.DHT.DhtPacket

Documentation

data DhtPacket Source #

Instances

Instances details
Eq DhtPacket Source # 
Instance details

Defined in Network.Tox.DHT.DhtPacket

Read DhtPacket Source # 
Instance details

Defined in Network.Tox.DHT.DhtPacket

Show DhtPacket Source # 
Instance details

Defined in Network.Tox.DHT.DhtPacket

Generic DhtPacket Source # 
Instance details

Defined in Network.Tox.DHT.DhtPacket

Associated Types

type Rep DhtPacket :: Type -> Type #

Arbitrary DhtPacket Source # 
Instance details

Defined in Network.Tox.DHT.DhtPacket

Binary DhtPacket Source # 
Instance details

Defined in Network.Tox.DHT.DhtPacket

MessagePack DhtPacket Source # 
Instance details

Defined in Network.Tox.DHT.DhtPacket

type Rep DhtPacket Source # 
Instance details

Defined in Network.Tox.DHT.DhtPacket

type Rep DhtPacket = D1 ('MetaData "DhtPacket" "Network.Tox.DHT.DhtPacket" "toxcore-0.2.11-inplace" 'False) (C1 ('MetaCons "DhtPacket" 'PrefixI 'True) (S1 ('MetaSel ('Just "senderPublicKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PublicKey) :*: (S1 ('MetaSel ('Just "encryptionNonce") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Nonce) :*: S1 ('MetaSel ('Just "encryptedPayload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CipherText))))

encode :: Binary payload => KeyPair -> PublicKey -> Nonce -> payload -> DhtPacket Source #

encodeKeyed :: (Binary payload, Keyed m) => KeyPair -> PublicKey -> Nonce -> payload -> m DhtPacket Source #

decode :: Binary payload => KeyPair -> DhtPacket -> Maybe payload Source #

decodeKeyed :: (Binary payload, Keyed m) => KeyPair -> DhtPacket -> m (Maybe payload) Source #