implement h2::server::Stream::send_reset(Reason) and Body::is_empty() (#22)

This commit is contained in:
Oliver Gould
2017-08-23 12:48:00 -07:00
committed by Carl Lerche
parent e8f757457b
commit f839443ece
7 changed files with 87 additions and 3 deletions

View File

@@ -1,12 +1,12 @@
use {frame, ConnectionError, StreamId};
use Body;
use {frame, Body, ConnectionError, StreamId};
use proto::{self, Connection, WindowSize};
use error::Reason;
use error::Reason::*;
use http::{self, Request, Response};
use futures::{self, Future, Sink, Poll, Async, AsyncSink, IntoFuture};
use tokio_io::{AsyncRead, AsyncWrite};
use bytes::{Bytes, IntoBuf};
use bytes::{Bytes, IntoBuf, Buf};
use std::fmt;
@@ -191,6 +191,10 @@ impl<B: IntoBuf> Stream<B> {
{
unimplemented!();
}
pub fn send_reset(mut self, reason: Reason) -> Result<(), ConnectionError> {
self.inner.send_reset::<Peer>(reason)
}
}
impl Stream<Bytes> {