var searchIndex = {}; searchIndex["nat_traversal"] = {"doc":"# `nat_traversal`\nNAT traversal utilities.","items":[[3,"MappingContext","nat_traversal","You need to create a `MappingContext` before doing any socket mapping. This\n`MappingContext` should ideally be kept throughout the lifetime of the\nprogram. Internally it caches a addresses of UPnP servers and hole punching\nservers.",null,null],[3,"MappedSocketAddr","","A socket address obtained through some mapping technique.",null,null],[12,"addr","","The mapped address",0,null],[12,"nat_restricted","","Indicated that hole punching needs to be used for an external client to connect to this\naddress. `nat_restricted` will not be set if this is a fully mapped address such as the\nexternal address of a full-cone NAT or one obtained through UPnP.",0,null],[3,"PrivRendezvousInfo","","The local half of a `PubRendezvousInfo`.",null,null],[3,"PubRendezvousInfo","","Info exchanged by both parties before performing a rendezvous connection.",null,null],[3,"MappedUdpSocket","","A bound udp socket for which we know our external endpoints.",null,null],[12,"socket","","The socket.",1,null],[12,"endpoints","","The known endpoints of this socket.",1,null],[3,"PunchedUdpSocket","","A udp socket that has been hole punched.",null,null],[12,"socket","","The UDP socket.",2,null],[12,"peer_addr","","The remote address that this socket is able to send messages to and receive messages from.",2,null],[3,"MappedTcpSocket","","A tcp socket for which we know our external endpoints.",null,null],[12,"socket","","A bound, but neither listening or connected tcp socket. The socket is\nbound to be reuseable (ie. SO_REUSEADDR is set as is SO_REUSEPORT on\nunix).",3,null],[12,"endpoints","","The known endpoints of this socket.",3,null],[3,"SimpleUdpHolePunchServer","","RAII type for a hole punch server which speaks the simple hole punching protocol.",null,null],[3,"SimpleTcpHolePunchServer","","RAII type for a hole punch server which speaks the simple hole punching protocol.",null,null],[4,"MappingContextNewError","","",null,null],[13,"ListInterfaces","","Failed to list the local machine's network interfaces.",4,null],[12,"err","nat_traversal::MappingContextNewError","",4,null],[13,"SpawnThread","nat_traversal","Failed to spawn a thread.",4,null],[12,"err","nat_traversal::MappingContextNewError","",4,null],[4,"MappingContextNewWarning","nat_traversal","",null,null],[13,"SearchGateway","","Error finding IGD gateway. `if_name` and `if_addr` indicate the network interface being\nsearched from when this error was raised.",5,null],[12,"if_name","nat_traversal::MappingContextNewWarning","",5,null],[12,"if_addr","","",5,null],[12,"err","","",5,null],[4,"MappedUdpSocketMapError","nat_traversal","Errors returned by MappedUdpSocket::map",null,null],[13,"SocketLocalAddr","","Error getting the local address of the socket.",6,null],[12,"err","nat_traversal::MappedUdpSocketMapError","",6,null],[13,"RecvError","nat_traversal","IO error receiving data on the socket.",6,null],[12,"err","nat_traversal::MappedUdpSocketMapError","",6,null],[13,"SendError","nat_traversal","IO error sending data on the socket.",6,null],[12,"err","nat_traversal::MappedUdpSocketMapError","",6,null],[4,"MappedUdpSocketMapWarning","nat_traversal","Warnings raised by MappedUdpSocket::map",null,null],[13,"FindGateway","","Error searching for IGD gateway",7,null],[12,"err","nat_traversal::MappedUdpSocketMapWarning","",7,null],[13,"GetExternalPort","nat_traversal","Error mapping external address and port through IGD gateway. `gateway_addr` is the\naddress of the IGD gateway that we requested a port mapping from.",7,null],[12,"gateway_addr","nat_traversal::MappedUdpSocketMapWarning","",7,null],[12,"err","","",7,null],[4,"MappedUdpSocketNewError","nat_traversal","Errors returned by MappedUdpSocket::new",null,null],[13,"CreateSocket","","Error creating new udp socket bound to 0.0.0.0:0",8,null],[12,"err","nat_traversal::MappedUdpSocketNewError","",8,null],[13,"MapSocket","nat_traversal","Error mapping udp socket.",8,null],[12,"err","nat_traversal::MappedUdpSocketNewError","",8,null],[4,"MappedTcpSocketMapError","nat_traversal","Errors returned by MappedTcpSocket::map",null,null],[13,"SocketLocalAddr","","Error getting local address of the socket. Most likely, bind() has not been called on\nthe socket.",9,null],[12,"err","nat_traversal::MappedTcpSocketMapError","",9,null],[4,"MappedTcpSocketMapWarning","nat_traversal","Warnings raised by MappedTcpSocket::map",null,null],[13,"FindGateway","","Error searching for an IGD gateway.",10,null],[12,"err","nat_traversal::MappedTcpSocketMapWarning","",10,null],[13,"GetExternalPort","nat_traversal","Error mapping external address and port through IGD gateway.",10,null],[12,"gateway_addr","nat_traversal::MappedTcpSocketMapWarning","",10,null],[12,"err","","",10,null],[13,"NewReusablyBoundTcpSocket","nat_traversal","Error creating a reusably bound temporary socket for mapping.",10,null],[12,"err","nat_traversal::MappedTcpSocketMapWarning","",10,null],[13,"MappingSocketConnect","nat_traversal","Error connecting to a mapping server.",10,null],[12,"addr","nat_traversal::MappedTcpSocketMapWarning","",10,null],[12,"err","","",10,null],[13,"MappingSocketWrite","nat_traversal","Error writing to temporary socket.",10,null],[12,"err","nat_traversal::MappedTcpSocketMapWarning","",10,null],[13,"MappingSocketRead","nat_traversal","Error reading from temporary socket.",10,null],[12,"err","nat_traversal::MappedTcpSocketMapWarning","",10,null],[13,"Deserialise","nat_traversal","Error deserialising a response from a mapping server.",10,null],[12,"addr","nat_traversal::MappedTcpSocketMapWarning","",10,null],[12,"err","","",10,null],[12,"response","","",10,null],[4,"MappedTcpSocketNewError","nat_traversal","Errors returned by MappedTcpSocket::new",null,null],[13,"NewReusablyBoundTcpSocket","","Error creating a reusably bound tcp socket.",11,null],[12,"err","nat_traversal::MappedTcpSocketNewError","",11,null],[13,"Map","nat_traversal","Error mapping new socket.",11,null],[12,"err","nat_traversal::MappedTcpSocketNewError","",11,null],[4,"NewReusablyBoundTcpSocketError","nat_traversal","Errors returned by new_reusably_bound_tcp_socket",null,null],[13,"Create","","Error creating socket.",12,null],[12,"err","nat_traversal::NewReusablyBoundTcpSocketError","",12,null],[13,"EnableReuseAddr","nat_traversal","Error setting SO_REUSEADDR on socket.",12,null],[12,"err","nat_traversal::NewReusablyBoundTcpSocketError","",12,null],[13,"EnableReusePort","nat_traversal","Error setting SO_REUSEPORT (or equivalent) on socket.",12,null],[12,"err","nat_traversal::NewReusablyBoundTcpSocketError","",12,null],[13,"Bind","nat_traversal","Error binding new socket to the provided address. Likely a socket was already bound to\nthis address without SO_REUSEPORT and SO_REUSEADDR being set.",12,null],[12,"err","nat_traversal::NewReusablyBoundTcpSocketError","",12,null],[4,"TcpPunchHoleWarning","nat_traversal","",null,null],[13,"Connect","","Connecting to endpoint failed.",13,null],[12,"peer_addr","nat_traversal::TcpPunchHoleWarning","",13,null],[12,"err","","",13,null],[13,"Accept","nat_traversal","Error accepting an incoming connection.",13,null],[12,"err","nat_traversal::TcpPunchHoleWarning","",13,null],[13,"StreamSetTimeout","nat_traversal","Error setting the timeout on a connected stream.",13,null],[12,"err","nat_traversal::TcpPunchHoleWarning","",13,null],[13,"StreamIo","nat_traversal","IO error communicating with a connected host.",13,null],[12,"peer_addr","nat_traversal::TcpPunchHoleWarning","",13,null],[12,"err","","",13,null],[13,"InvalidResponse","nat_traversal","A connected host provided an invalid response to the handshake.",13,null],[12,"peer_addr","nat_traversal::TcpPunchHoleWarning","",13,null],[12,"data","","",13,null],[4,"TcpPunchHoleError","nat_traversal","",null,null],[13,"SocketLocalAddr","","Error getting the local address of the provided socket.",14,null],[12,"err","nat_traversal::TcpPunchHoleError","",14,null],[13,"NewReusablyBoundTcpSocket","nat_traversal","Error binding another socket to the same local address as the provided socket.",14,null],[12,"err","nat_traversal::TcpPunchHoleError","",14,null],[13,"Listen","nat_traversal","Error listening on the provided socket.",14,null],[12,"err","nat_traversal::TcpPunchHoleError","",14,null],[13,"TimedOut","nat_traversal","Tcp hole punching timed out without making a successful connection.",14,null],[12,"warnings","nat_traversal::TcpPunchHoleError","",14,null],[13,"DecideStream","nat_traversal","Multiple streams were successfully punched to the peer but all of them died.",14,null],[12,"errors","nat_traversal::TcpPunchHoleError","",14,null],[4,"SimpleUdpHolePunchServerNewError","nat_traversal","Errors returned by SimpleUdpHolePunchServer::new",null,null],[13,"CreateMappedSocket","","Error creating a mapped udp socket to listen on.",15,null],[12,"err","nat_traversal::SimpleUdpHolePunchServerNewError","",15,null],[13,"SetSocketTimeout","nat_traversal","Error setting the timeout on the server's listening socket.",15,null],[12,"err","nat_traversal::SimpleUdpHolePunchServerNewError","",15,null],[4,"SimpleTcpHolePunchServerNewError","nat_traversal","Errors returned by SimpleTcpHolePunchServer::new",null,null],[13,"CreateMappedSocket","","Error creating a mapped tcp socket to listen on.",16,null],[12,"err","nat_traversal::SimpleTcpHolePunchServerNewError","",16,null],[13,"Listen","nat_traversal","",16,null],[12,"err","nat_traversal::SimpleTcpHolePunchServerNewError","",16,null],[13,"SocketLocalAddr","nat_traversal","",16,null],[12,"err","nat_traversal::SimpleTcpHolePunchServerNewError","",16,null],[5,"gen_rendezvous_info","nat_traversal","Create a `(PrivRendezvousInfo, PubRendezvousInfo)` pair from a list of\nmapped socket addresses.",null,null],[5,"filter_udp_hole_punch_packet","","Returns `None` if `data` looks like a hole punching message. Otherwise returns the data it was\ngiven.",null,null],[5,"new_reusably_bound_tcp_socket","","",null,{"inputs":[{"name":"socketaddr"}],"output":{"name":"result"}}],[5,"tcp_punch_hole","","Perform a tcp rendezvous connect. `socket` should have been obtained from a\n`MappedTcpSocket`.",null,{"inputs":[{"name":"tcpbuilder"},{"name":"privrendezvousinfo"},{"name":"pubrendezvousinfo"},{"name":"instant"}],"output":{"name":"wresult"}}],[11,"fmt","","",4,null],[11,"fmt","","",4,null],[11,"description","","",4,null],[11,"cause","","",4,null],[11,"fmt","","",5,null],[11,"fmt","","",5,null],[11,"description","","",5,null],[11,"cause","","",5,null],[11,"new","","Create a new mapping context. This will block breifly while it searches\nthe network for UPnP servers.",17,{"inputs":[],"output":{"name":"wresult"}}],[11,"add_simple_udp_servers","","Inform the context about external servers that speak the UDP simple hole punch server\nprotocol.",17,null],[11,"add_simple_tcp_servers","","Inform the context about external servers that speak the TCP simple hole punch server\nprotocol.",17,null],[11,"decode","","",0,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",0,null],[11,"clone","","",0,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"fmt","","",0,null],[11,"decode","","",18,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",18,null],[11,"eq","","",18,null],[11,"ne","","",18,null],[11,"clone","","",18,null],[11,"fmt","","",18,null],[11,"eq","","",19,null],[11,"ne","","",19,null],[11,"clone","","",19,null],[11,"fmt","","",19,null],[11,"fmt","","",6,null],[11,"fmt","","",6,null],[11,"description","","",6,null],[11,"cause","","",6,null],[11,"fmt","","",7,null],[11,"fmt","","",7,null],[11,"description","","",7,null],[11,"cause","","",7,null],[11,"fmt","","",8,null],[11,"fmt","","",8,null],[11,"description","","",8,null],[11,"cause","","",8,null],[11,"map","","Map an existing `UdpSocket`.",1,{"inputs":[{"name":"udpsocket"},{"name":"mappingcontext"},{"name":"instant"}],"output":{"name":"wresult"}}],[11,"new","","Create a new `MappedUdpSocket`",1,{"inputs":[{"name":"mappingcontext"},{"name":"instant"}],"output":{"name":"wresult"}}],[11,"punch_hole","","Punch a udp socket using a mapped socket and the peer's rendezvous info.",2,{"inputs":[{"name":"udpsocket"},{"name":"privrendezvousinfo"},{"name":"pubrendezvousinfo"},{"name":"instant"}],"output":{"name":"wresult"}}],[11,"fmt","","",9,null],[11,"fmt","","",9,null],[11,"description","","",9,null],[11,"cause","","",9,null],[11,"fmt","","",10,null],[11,"fmt","","",10,null],[11,"description","","",10,null],[11,"cause","","",10,null],[11,"fmt","","",11,null],[11,"fmt","","",11,null],[11,"description","","",11,null],[11,"cause","","",11,null],[11,"fmt","","",12,null],[11,"fmt","","",12,null],[11,"description","","",12,null],[11,"cause","","",12,null],[11,"map","","Map an existing tcp socket. The socket must bound but not connected. It must have been\nbound with SO_REUSEADDR and SO_REUSEPORT options (or equivalent) set.",3,{"inputs":[{"name":"tcpbuilder"},{"name":"mappingcontext"},{"name":"instant"}],"output":{"name":"wresult"}}],[11,"new","","Create a new `MappedTcpSocket`",3,{"inputs":[{"name":"mappingcontext"},{"name":"instant"}],"output":{"name":"wresult"}}],[11,"fmt","","",13,null],[11,"fmt","","",13,null],[11,"description","","",13,null],[11,"cause","","",13,null],[11,"fmt","","",14,null],[11,"fmt","","",14,null],[11,"description","","",14,null],[11,"cause","","",14,null],[11,"fmt","","",15,null],[11,"fmt","","",15,null],[11,"description","","",15,null],[11,"cause","","",15,null],[11,"new","","Create a new server. This will spawn a background thread which will serve requests until\nthe server is dropped.",20,{"inputs":[{"name":"t"},{"name":"instant"}],"output":{"name":"wresult"}}],[11,"addresses","","Get the external addresses of this server to be shared with peers.",20,null],[11,"drop","","",20,null],[11,"fmt","","",16,null],[11,"fmt","","",16,null],[11,"description","","",16,null],[11,"cause","","",16,null],[11,"new","","Create a new server. This will spawn a background thread which will serve requests until\nthe server is dropped.",21,{"inputs":[{"name":"t"},{"name":"instant"}],"output":{"name":"wresult"}}],[11,"addresses","","Get the external addresses of this server to be shared with peers.",21,null],[11,"drop","","",21,null]],"paths":[[3,"MappedSocketAddr"],[3,"MappedUdpSocket"],[3,"PunchedUdpSocket"],[3,"MappedTcpSocket"],[4,"MappingContextNewError"],[4,"MappingContextNewWarning"],[4,"MappedUdpSocketMapError"],[4,"MappedUdpSocketMapWarning"],[4,"MappedUdpSocketNewError"],[4,"MappedTcpSocketMapError"],[4,"MappedTcpSocketMapWarning"],[4,"MappedTcpSocketNewError"],[4,"NewReusablyBoundTcpSocketError"],[4,"TcpPunchHoleWarning"],[4,"TcpPunchHoleError"],[4,"SimpleUdpHolePunchServerNewError"],[4,"SimpleTcpHolePunchServerNewError"],[3,"MappingContext"],[3,"PubRendezvousInfo"],[3,"PrivRendezvousInfo"],[3,"SimpleUdpHolePunchServer"],[3,"SimpleTcpHolePunchServer"]]}; initSearch(searchIndex);