More restructuring

This commit is contained in:
Carl Lerche
2017-08-02 14:48:10 -07:00
parent 77681674e2
commit 9f9bf85168
7 changed files with 105 additions and 89 deletions

View File

@@ -30,11 +30,10 @@ pub mod error;
mod hpack;
mod proto;
mod frame;
pub mod server;
// pub mod server;
pub use error::{ConnectionError, Reason};
pub use frame::StreamId;
pub use proto::Connection;
use bytes::Bytes;
@@ -68,23 +67,3 @@ pub enum Frame<T, B = Bytes> {
error: Reason,
},
}
/// Either a Client or a Server
pub trait Peer {
/// Message type sent into the transport
type Send;
/// Message type polled from the transport
type Poll;
fn is_server() -> bool;
#[doc(hidden)]
fn convert_send_message(
id: StreamId,
headers: Self::Send,
end_of_stream: bool) -> frame::Headers;
#[doc(hidden)]
fn convert_poll_message(headers: frame::Headers) -> Self::Poll;
}