Trait bip_dht::Handshaker [] [src]

pub trait Handshaker: Send {
    type MetadataEnvelope: Send;
    fn id(&self) -> ShaHash;
    fn port(&self) -> u16;
    fn connect(
        &mut self,
        expected: Option<ShaHash>,
        hash: ShaHash,
        addr: SocketAddr
    ); fn metadata(&mut self, data: Self::MetadataEnvelope); }

Trait for peer discovery services to forward peer contact information and metadata.

Associated Types

Type that metadata will be passed back to the client as.

Required Methods

PeerId exposed to peer discovery services.

Port exposed to peer discovery services.

It is important that this is the external port that the peer will be sending data to. This is relevant if the client employs nat traversal via upnp or other means.

Connect to the given address with the InfoHash and expecting the PeerId.

Send the given Metadata back to the client.

Implementors