mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-30 10:11:33 +00:00
Add varint-rs
This commit is contained in:
22
libp2p-stream-muxer/src/lib.rs
Normal file
22
libp2p-stream-muxer/src/lib.rs
Normal file
@ -0,0 +1,22 @@
|
||||
extern crate tokio_io;
|
||||
extern crate futures;
|
||||
|
||||
use futures::stream::Stream;
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
|
||||
pub trait StreamMuxer {
|
||||
type Substream: AsyncRead + AsyncWrite;
|
||||
type InboundSubstreams: Stream<Item = Self::Substream>;
|
||||
type OutboundSubstreams: Stream<Item = Self::Substream>;
|
||||
|
||||
fn inbound(&mut self) -> Self::InboundSubstreams;
|
||||
fn outbound(&mut self) -> Self::OutboundSubstreams;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user