Struct bip_handshake::HandshakerBuilder
[−]
[src]
pub struct HandshakerBuilder { /* fields omitted */ }
Build configuration for Handshaker
object creation.
Methods
impl HandshakerBuilder
[src]
fn new() -> HandshakerBuilder
Create a new HandshakerBuilder
.
fn with_bind_addr(&mut self, addr: SocketAddr) -> &mut HandshakerBuilder
Address that the host will listen on.
Defaults to IN_ADDR_ANY using port 0 (any free port).
fn with_open_port(&mut self, port: u16) -> &mut HandshakerBuilder
Port that external peers should connect on.
Defaults to the port that is being listened on (will only work if the host is not natted).
fn with_peer_id(&mut self, peer_id: PeerId) -> &mut HandshakerBuilder
Peer id that will be advertised when handshaking with other peers.
Defaults to a random SHA-1 hash; official clients should use an encoding scheme.
fn with_extensions(&mut self, ext: Extensions) -> &mut HandshakerBuilder
Extensions supported by our client, advertised to the peer when handshaking.
fn with_config(&mut self, config: HandshakerConfig) -> &mut HandshakerBuilder
Configuration that will be used to alter the internal behavior of handshaking.
This will typically not need to be set unless you know what you are doing.
fn build<T>(&self, handle: Handle) -> Result<Handshaker<T::Socket>> where
T: Transport + 'static,
T: Transport + 'static,
Build a Handshaker
over the given Transport
with a Remote
instance.
Trait Implementations
impl Copy for HandshakerBuilder
[src]
impl Clone for HandshakerBuilder
[src]
fn clone(&self) -> HandshakerBuilder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more