mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-23 06:41:34 +00:00
Add an Error associated type to transports (#835)
* Add an Error associated type to transports * Improve raw swarm a bit * Rename map_other to map * Use source() instead of cause() * RawSwarmIncErr -> IncomingError
This commit is contained in:
@ -51,7 +51,8 @@
|
||||
//! .map(|out: SecioOutput<_>, _| out.stream);
|
||||
//!
|
||||
//! let future = dialer.dial("/ip4/127.0.0.1/tcp/12345".parse::<Multiaddr>().unwrap())
|
||||
//! .unwrap_or_else(|_| panic!("Unable to dial node"))
|
||||
//! .unwrap()
|
||||
//! .map_err(|e| panic!("error: {:?}", e))
|
||||
//! .and_then(|connection| {
|
||||
//! // Sends "hello world" on the connection, will be encrypted.
|
||||
//! write_all(connection, "hello world")
|
||||
|
Reference in New Issue
Block a user