logo
pub struct DialOpts(_);
Expand description

Options to configure a dial to a known or unknown peer.

Used in Swarm::dial and NetworkBehaviourAction::Dial.

To construct use either of:

Implementations

Dial a known peer.

DialOpts::peer_id(PeerId::random())
   .condition(PeerCondition::Disconnected)
   .addresses(vec!["/ip6/::1/tcp/12345".parse().unwrap()])
   .extend_addresses_through_behaviour()
   .build();

Dial an unknown peer.

DialOpts::unknown_peer_id()
   .address("/ip6/::1/tcp/12345".parse().unwrap())
   .build();

Get the PeerId specified in a DialOpts if any.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.