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

Network.Tox.DHT.NodeList

Documentation

class NodeList l where Source #

Methods

addNode :: Timestamp -> NodeInfo -> l -> l Source #

removeNode :: PublicKey -> l -> l Source #

viable :: NodeInfo -> l -> Bool Source #

baseKey :: l -> PublicKey Source #

traverseClientLists :: Applicative f => (ClientList -> f ClientList) -> l -> f l Source #

closeNodes :: PublicKey -> l -> [(Distance, NodeInfo)] Source #

'closeNodes pub' returns the (pub',node) pairs of the Node List in increasing order of distance of pub' from pub.

foldMapClientLists :: Monoid m => (ClientList -> m) -> l -> m Source #

copied from Data.Traversable.foldMapDefault

foldlClientLists :: (a -> ClientList -> a) -> a -> l -> a Source #

copied from Data.Foldable.foldl

nodeListList :: l -> [NodeInfo] Source #

foldNodes :: (a -> NodeInfo -> a) -> a -> l -> a Source #

lookupPublicKey :: PublicKey -> l -> Maybe NodeInfo Source #

Instances

Instances details
NodeList ClientList Source # 
Instance details

Defined in Network.Tox.DHT.NodeList

NodeList KBuckets Source # 
Instance details

Defined in Network.Tox.DHT.NodeList

NodeList DhtState Source #

although it is not referred to as a Node List in the spec, we make DhtState an instance of NodeList so we can use the traversal and folding functions.

Instance details

Defined in Network.Tox.DHT.DhtState