Add missing pub(crate) statements.

This commit is contained in:
Yannick Heinrich
2018-10-05 13:46:38 +02:00
committed by Sean McArthur
parent 4857a5917d
commit 647f59756e
10 changed files with 39 additions and 57 deletions

View File

@@ -146,38 +146,36 @@ impl fmt::Debug for Chunk {
}
}
// pub(crate)
#[inline]
pub fn wrap(body: ::hyper::Body) -> Body {
pub(crate) fn wrap(body: ::hyper::Body) -> Body {
Body {
inner: Inner::Hyper(body),
}
}
#[inline]
pub fn empty() -> Body {
pub(crate) fn empty() -> Body {
Body {
inner: Inner::Hyper(::hyper::Body::empty()),
}
}
#[inline]
pub fn chunk(chunk: Bytes) -> Chunk {
pub(crate) fn chunk(chunk: Bytes) -> Chunk {
Chunk {
inner: ::hyper::Chunk::from(chunk)
}
}
#[inline]
pub fn reusable(chunk: Bytes) -> Body {
pub(crate) fn reusable(chunk: Bytes) -> Body {
Body {
inner: Inner::Reusable(chunk),
}
}
#[inline]
pub fn into_hyper(body: Body) -> (Option<Bytes>, ::hyper::Body) {
pub(crate) fn into_hyper(body: Body) -> (Option<Bytes>, ::hyper::Body) {
match body.inner {
Inner::Reusable(chunk) => (Some(chunk.clone()), chunk.into()),
Inner::Hyper(b) => (None, b),

View File

@@ -304,7 +304,7 @@ impl<R: Read> Read for Peeked<R> {
impl<S> ReadableChunks<S> {
#[inline]
pub fn new(stream: S) -> Self {
pub(crate) fn new(stream: S) -> Self {
ReadableChunks {
state: ReadState::NotReady,
stream: stream,
@@ -387,15 +387,13 @@ impl<S> ReadableChunks<S>
}
}
// pub(crate)
/// Constructs a Decoder from a hyper request.
///
/// A decoder is just a wrapper around the hyper request that knows
/// how to decode the content body of the request.
///
/// Uses the correct variant by inspecting the Content-Encoding header.
pub fn detect(headers: &mut HeaderMap, body: Body, check_gzip: bool) -> Decoder {
pub(crate) fn detect(headers: &mut HeaderMap, body: Body, check_gzip: bool) -> Decoder {
if !check_gzip {
return Decoder::plain_text(body);
}

View File

@@ -164,6 +164,7 @@ impl<T: Into<body::Body>> From<http::Response<T>> for Response {
}
}
/// A JSON object.
pub struct Json<T> {
concat: Concat2<Decoder>,
_marker: PhantomData<T>,