var searchIndex = {}; searchIndex["kademlia_routing_table"] = {"doc":"# Kademlia Routing Table","items":[[3,"NodeInfo","kademlia_routing_table","Allows user defined data for routing table",null,null],[12,"public_id","","container for node in routing table",0,null],[12,"connections","","connection object, may be socket etc.",0,null],[3,"RoutingTable","","The RoutingTable class is used to maintain a list of contacts to which the node is connected.",null,null],[17,"GROUP_SIZE","","Defines the size of close group",null,null],[17,"QUORUM_SIZE","","Quorum size.",null,null],[17,"PARALLELISM","","Defines the number of contacts which should be returned by the `target_nodes` function for a\ntarget which is outwith our close group and is not a contact in the table.",null,null],[8,"HasName","","required trait for the info held on a node by routing_table",null,null],[10,"name","","return xor_name for this type",1,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"fmt","","",0,null],[11,"clone","","",0,null],[11,"new","","constructor",0,{"inputs":[{"name":"t"},{"name":"vec"}],"output":{"name":"nodeinfo"}}],[11,"name","","name of routing table entry",0,null],[11,"new","","constructor",2,{"inputs":[{"name":"xorname"}],"output":{"name":"routingtable"}}],[11,"add_node","","Adds a contact to the routing table. If the contact is added, the first return arg is true,\notherwise false. If adding the contact caused another contact to be dropped, the dropped\none is returned in the second field, otherwise the optional field is empty.",2,null],[11,"add_connection","","Adds a connection to an existing entry. Should be called after `has_node`. The return\nindicates if the given connection was added to an existing NodeInfo.",2,null],[11,"want_to_add","","This is used to check whether it is worthwhile trying to connect to the peer with a view to\nadding the contact to our routing table, i.e. would this contact improve our table. The\nchecking procedure is the same as for `add_node`, except for the lack of a public key to\ncheck in step 1.",2,null],[11,"drop_node","","This unconditionally removes the contact from the table.",2,null],[11,"drop_connection","","This should be called when a connection has dropped. If the\naffected entry has no connections after removing this one, the entry is removed from the\nrouting table and its name is returned. If the entry still has at least one connection, or\nan entry cannot be found for 'lost_connection', the function returns 'None'.",2,null],[11,"target_nodes","","This returns a collection of contacts to which a message should be sent onwards. It will\nreturn all of our close group (comprising 'GROUP_SIZE' contacts) if the closest one to the\ntarget is within our close group. If not, it will return either the 'PARALLELISM' closest\ncontacts to the target or a single contact if 'target' is the name of a contact in the table.",2,null],[11,"our_close_group","","This returns our close group, i.e. the 'GROUP_SIZE' contacts closest to our name (or the\nentire table if we hold less than 'GROUP_SIZE' contacts in total) sorted by closeness to us.",2,null],[11,"is_close","","This returns true if the provided name is closer than or equal to the furthest node in our\nclose group. If the routing table contains less than GROUP_SIZE nodes, then every address is\nconsidered to be close.",2,null],[11,"len","","number of elements",2,null],[11,"is_empty","","empty",2,null],[11,"our_name","","routing table name",2,null],[11,"has_node","","check is routing table contains name",2,null]],"paths":[[3,"NodeInfo"],[8,"HasName"],[3,"RoutingTable"]]}; initSearch(searchIndex);