Module libp2p_core::transport

source ·
Expand description

Handles entering a connection with a peer.

The two main elements of this module are the Transport and ConnectionUpgrade traits. Transport is implemented on objects that allow dialing and listening. ConnectionUpgrade is implemented on objects that make it possible to upgrade a connection (for example by adding an encryption middleware to the connection).

Thanks to the Transport::or_transport, Transport::with_upgrade and UpgradedNode::or_upgrade methods, you can combine multiple transports and/or upgrades together in a complex chain of protocols negotiation.

Re-exports

pub use self::choice::OrTransport;
pub use self::memory::connector;
pub use self::upgrade::Upgrade;

Modules

Wraps around a Transport and adds a timeout to all the incoming and outgoing connections.

Traits

A transport is an object that can be used to produce connections by listening or dialing a peer.