var searchIndex = {}; searchIndex["crust"] = {"doc":"#crust\nReliable peer-to-peer network connections in Rust with NAT traversal.","items":[[3,"ConnectionInfoResult","crust","The result of a `Service::prepare_contact_info` call.",null,null],[12,"result_token","","The token that was passed to `prepare_connection_info`.",0,null],[12,"result","","The new contact info, if successful.",0,null],[3,"PeerId","","An identifier of a peer node.",null,null],[12,"0","","",1,null],[3,"PrivConnectionInfo","","Contact info generated by a call to `Service::prepare_contact_info`.",null,null],[3,"PubConnectionInfo","","Contact info used to connect to another peer.",null,null],[3,"Service","","A structure representing a connection manager. This is the main object through which crust is\nused.",null,null],[4,"CrustError","","Crust's universal error type.",null,null],[13,"ChannelRecv","","Failed receiving from an mpsc::channel",2,null],[13,"ConfigFileHandler","","Config file handling errors",2,null],[13,"Io","","Wrapper for a `std::io::Error`",2,null],[13,"ServiceDiscNotEnabled","","ServiceDiscovery not enabled yet",2,null],[13,"ServiceDisc","","ServiceDiscovery Errors",2,null],[13,"InsufficientConnectionInfo","","ServiceDiscovery not enabled yet",2,null],[13,"Nat","","Nat Traversal errors",2,null],[13,"MioTimer","","Mio Timer errors",2,null],[13,"Common","","Common module errors",2,null],[13,"MioNotify","","Mio notify errors",2,null],[13,"PeerNotFound","","Peer not found",2,null],[13,"Serialisation","","Serialisation error",2,null],[4,"Event","","Enum representing different events that will be sent over the asynchronous channel to the user\nof this module.",null,null],[13,"BootstrapAccept","","Invoked when a bootstrap peer connects to us",3,null],[13,"BootstrapConnect","","Invoked when we bootstrap to a new peer.",3,null],[13,"BootstrapFailed","","Invoked when we failed to connect to all bootstrap contacts.",3,null],[13,"ListenerStarted","","Invoked when we are ready to listen for incomming connection. Contains\nthe listening port.",3,null],[13,"ListenerFailed","","Invoked when listener failed to start.",3,null],[13,"ConnectionInfoPrepared","","Invoked as a result to the call of `Service::prepare_contact_info`.",3,null],[13,"ConnectSuccess","","Invoked when connection to a new peer has been established.",3,null],[13,"ConnectFailure","","Invoked when connection to a new peer has failed.",3,null],[13,"LostPeer","","Invoked when a peer disconnects or can no longer be contacted.",3,null],[13,"NewMessage","","Invoked when a new message is received. Passes the message.",3,null],[13,"WriteMsgSizeProhibitive","","Invoked when trying to sending a too large data.",3,null],[11,"fmt","","",3,null],[11,"fmt","","",2,null],[11,"fmt","","",2,null],[11,"description","","",2,null],[11,"cause","","",2,null],[11,"from","","",2,{"inputs":[{"name":"recverror"}],"output":{"name":"crusterror"}}],[11,"from","","",2,{"inputs":[{"name":"error"}],"output":{"name":"crusterror"}}],[11,"from","","",2,{"inputs":[{"name":"error"}],"output":{"name":"crusterror"}}],[11,"from","","",2,{"inputs":[{"name":"servicediscoveryerror"}],"output":{"name":"crusterror"}}],[11,"from","","",2,{"inputs":[{"name":"naterror"}],"output":{"name":"crusterror"}}],[11,"from","","",2,{"inputs":[{"name":"timererror"}],"output":{"name":"crusterror"}}],[11,"from","","",2,{"inputs":[{"name":"commonerror"}],"output":{"name":"crusterror"}}],[11,"from","","",2,{"inputs":[{"name":"notifyerror"}],"output":{"name":"crusterror"}}],[11,"from","","",2,{"inputs":[{"name":"serialisationerror"}],"output":{"name":"crusterror"}}],[11,"new","","Construct a service. `event_tx` is the sending half of the channel which crust will send\nnotifications on.",4,{"inputs":[{"name":"crusteventsender"}],"output":{"name":"res"}}],[11,"with_config","","Constructs a service with the given config. User needs to create an asynchronous channel,\nand provide the sender half to this method. Receiver will receive all `Event`s from this\nlibrary.",4,{"inputs":[{"name":"crusteventsender"},{"name":"config"}],"output":{"name":"res"}}],[11,"start_service_discovery","","Starts listening for beacon broadcasts.",4,null],[11,"set_service_discovery_listen","","Enable (or disable) listening and responding to peers searching for us. This can be used to\nallow others to discover us on the local network.",4,null],[11,"has_peers_on_lan","","Check if we have peers on LAN",4,null],[11,"start_bootstrap","","Start the bootstrapping procedure. It will auto terminate after indicating success or\nfailure via the event channel.",4,null],[11,"stop_bootstrap","","Stop the bootstraping procedure explicitly",4,null],[11,"start_listening_tcp","","Starts accepting TCP connections. This is persistant until it errors out or is stopped\nexplicitly.",4,null],[11,"stop_tcp_listener","","Stops Listener explicitly and stops accepting TCP connections.",4,null],[11,"connect","","Connect to a peer. To call this method you must follow these steps:\n* Generate a `PrivConnectionInfo` via `Service::prepare_connection_info`.\n* Create a `PubConnectionInfo` via `PrivConnectionInfo::to_pub_connection_info`.\n* Swap `PubConnectionInfo`s out-of-band with the peer you are connecting to.\n* Call `Service::connect` using your `PrivConnectionInfo` and the `PubConnectionInfo`\n obtained from the peer",4,null],[11,"disconnect","","Disconnect from the given peer and returns whether there was a connection at all.",4,null],[11,"send","","Send data to a peer.",4,null],[11,"prepare_connection_info","","Generate connection info. The connection info is returned via the `ConnectionInfoPrepared`\nevent on the event channel. Calling this method is the first step of connecting to another\npeer, see `Service::connect` for more info.",4,null],[11,"is_connected","","Check if we are connected to the given peer",4,null],[11,"id","","Returns our ID.",4,null],[11,"drop","","",4,null],[11,"decode","","",1,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",1,null],[11,"hash","","",1,null],[11,"partial_cmp","","",1,null],[11,"lt","","",1,null],[11,"le","","",1,null],[11,"gt","","",1,null],[11,"ge","","",1,null],[11,"cmp","","",1,null],[11,"clone","","",1,null],[11,"eq","","",1,null],[11,"ne","","",1,null],[11,"fmt","","",1,null],[11,"fmt","","",1,null],[11,"rand","","",1,{"inputs":[{"name":"r"}],"output":{"name":"self"}}],[11,"fmt","","",0,null],[11,"fmt","","",5,null],[11,"to_pub_connection_info","","Use private connection info to create public connection info that can be shared with the\npeer.",5,null],[11,"decode","","",6,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",6,null],[11,"fmt","","",6,null],[11,"id","","Returns the `PeerId` of the node that created this connection info.",6,null],[6,"Priority","","Priority of a message to be sent by Crust. A lower value means a higher priority, so Priority 0\nis the highest one. Low-priority messages will be preempted if need be to allow higher priority\nmessages through. Messages with a value `>= MSG_DROP_PRIORITY` will even be dropped, if\nbandwidth is insufficient.",null,null],[6,"CrustEventSender","","Used to receive events from a `Service`.",null,null],[6,"Res","","Crust's result type",null,null],[17,"MSG_DROP_PRIORITY","","Minimum priority for droppable messages. Messages with lower values will never be dropped.",null,null]],"paths":[[3,"ConnectionInfoResult"],[3,"PeerId"],[4,"CrustError"],[4,"Event"],[3,"Service"],[3,"PrivConnectionInfo"],[3,"PubConnectionInfo"]]}; initSearch(searchIndex);