Remove P generic from type

This commit is contained in:
Carl Lerche
2017-08-08 22:11:11 -07:00
parent 6a84a93f2e
commit 26df3a3698
6 changed files with 129 additions and 137 deletions

View File

@@ -15,9 +15,6 @@ pub struct Handshake<T, B: IntoBuf = Bytes> {
inner: Box<Future<Item = Client<T, B>, Error = ConnectionError>>,
}
#[derive(Debug)]
pub(crate) struct Peer;
/// Marker type indicating a client peer
pub struct Client<T, B: IntoBuf> {
connection: Connection<T, Peer, B>,
@@ -25,19 +22,22 @@ pub struct Client<T, B: IntoBuf> {
#[derive(Debug)]
pub struct Stream<B: IntoBuf> {
inner: proto::StreamRef<Peer, B::Buf>,
inner: proto::StreamRef<B::Buf>,
}
#[derive(Debug)]
pub struct Body<B: IntoBuf> {
inner: proto::StreamRef<Peer, B::Buf>,
inner: proto::StreamRef<B::Buf>,
}
#[derive(Debug)]
pub struct Chunk<B: IntoBuf> {
inner: proto::Chunk<Peer, B::Buf>,
inner: proto::Chunk<B::Buf>,
}
#[derive(Debug)]
pub(crate) struct Peer;
impl<T> Client<T, Bytes>
where T: AsyncRead + AsyncWrite + 'static,
{
@@ -160,7 +160,7 @@ impl<B: IntoBuf> Stream<B> {
pub fn send_data(&mut self, data: B, end_of_stream: bool)
-> Result<(), ConnectionError>
{
self.inner.send_data(data.into_buf(), end_of_stream)
self.inner.send_data::<Peer>(data.into_buf(), end_of_stream)
}
/// Send trailers