From 4fbcc2246fed7c22318f361937a7106513a2f84f Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Sun, 1 Jul 2018 19:01:35 +0200 Subject: [PATCH] doc --- src/body.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/body.rs b/src/body.rs index e2c6039..00d5433 100644 --- a/src/body.rs +++ b/src/body.rs @@ -14,6 +14,9 @@ use super::SerdeValue; #[cfg(feature = "json")] use serde_json; +/// The different kinds of bodies to send. +/// +/// *Internal API* pub enum Payload { Empty, Text(String, String), @@ -40,6 +43,9 @@ impl Default for Payload { } } +/// Payloads are turned into this type where we can hold both a size and the reader. +/// +/// *Internal API* pub struct SizedReader { pub size: Option, pub reader: Box, @@ -81,6 +87,7 @@ impl Payload { } } +/// Helper to send a body, either as chunked or not. pub fn send_body(mut body: SizedReader, do_chunk: bool, stream: &mut Stream) -> IoResult<()> { if do_chunk { let mut chunker = chunked_transfer::Encoder::new(stream);