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

@ -35,25 +35,25 @@ extern crate rand;
extern crate tokio_io;
extern crate varint;
mod read;
mod write;
mod shared;
mod header;
mod read;
mod shared;
mod write;
use bytes::Bytes;
use circular_buffer::Array;
use futures::{Async, Future, Poll};
use futures::future::{self, FutureResult};
use header::MultiplexHeader;
use swarm::muxing::StreamMuxer;
use swarm::{ConnectionUpgrade, Endpoint, Multiaddr};
use futures::{Async, Future, Poll};
use futures_mutex::Mutex;
use header::MultiplexHeader;
use read::{read_stream, MultiplexReadState};
use shared::{buf_from_slice, ByteBuf, MultiplexShared};
use std::iter;
use std::io::{self, Read, Write};
use std::iter;
use std::sync::Arc;
use std::sync::atomic::{self, AtomicUsize};
use swarm::muxing::StreamMuxer;
use swarm::{ConnectionUpgrade, Endpoint, Multiaddr};
use tokio_io::{AsyncRead, AsyncWrite};
use write::write_stream;