Struct service_discovery::ServiceDiscovery [] [src]

pub struct ServiceDiscovery<Reply: 'static + Encodable + Decodable + Send + Clone> {
    // some fields omitted
}

ServiceDiscovery is a RAII API for the purposes of discovering peers on the local network. To stop the process of discovery completely, it is sufficient to drop the instance of this struct.

Methods

impl<Reply: 'static + Encodable + Decodable + Send + Clone> ServiceDiscovery<Reply>
[src]

fn new(port: u16, reply: Reply) -> Result<Self>

Obtain a new RAII instance of ServiceDiscovery. By default listening to peers searching for us is disabled.

fn register_seek_peer_observer(&self, observer: Sender<Reply>) -> bool

Register a new observer to be notified whenever we successfully find peers by interrogating the network. Return value indicates acknowledgement of the request.

fn set_listen_for_peers(&self, listen: bool) -> bool

Enable or disable listening and responding to peers searching for us. This will correspondingly allow or disallow others from finding us by interrogating the network. Return value indicates acknowledgement of the request.

fn seek_peers(&self) -> bool

Interrogate the network to find peers. Return value indicates acknowledgement of the request.

Trait Implementations

impl<Reply: 'static + Encodable + Decodable + Send + Clone> Drop for ServiceDiscovery<Reply>
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more