Swarm rework (#182)

* Rename Transport::RawConn to Output

* Remove AsyncRead + AsyncWrite bound on Transport::Output

* UpgradedNode now always implements Transport

* Add and tweak modifiers for Transport and ConnectionUpgrade

* Secio upgrade now returns the pubkey in its output

* Add upgrade::apply

* Add Transport::and_then

* Rework the swarm

* Rustfmt

* Fix concerns
This commit is contained in:
Pierre Krieger
2018-05-14 15:55:16 +02:00
committed by GitHub
parent 4382adcbde
commit f787f3d8b8
58 changed files with 833 additions and 526 deletions

View File

@ -29,8 +29,8 @@
extern crate smallvec;
use std::ops::Drop;
use std::mem::ManuallyDrop;
use std::ops::Drop;
pub use smallvec::Array;
@ -41,8 +41,8 @@ use owned_slice::OwnedSlice;
/// elements of these slices would be leaked after the slice goes out of scope. `OwnedSlice` simply
/// manually drops all its elements when it goes out of scope.
pub mod owned_slice {
use std::ops::{Deref, DerefMut, Drop};
use std::mem::ManuallyDrop;
use std::ops::{Deref, DerefMut, Drop};
/// A slice that owns its elements, but not their storage. This is useful for things like
/// `Vec::retain` and `CircularBuffer::pop_slice`, since these functions can return a slice but