From 4f6145e5c715b6dc79ba8eb0e9ac9679313d3e15 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 19 Dec 2017 00:29:25 -0800 Subject: [PATCH] fix typos --- guide/src/qs_7.md | 2 +- src/payload.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/guide/src/qs_7.md b/guide/src/qs_7.md index e3248068d..b1fa3579e 100644 --- a/guide/src/qs_7.md +++ b/guide/src/qs_7.md @@ -122,7 +122,7 @@ fn index(req: HttpRequest) -> HttpResponse { ## Streaming request -Actix uses [*Payload*](../actix_web/struct.Payload.html) object as request payload stream. +Actix uses [*Payload*](../actix_web/payload/struct.Payload.html) object as request payload stream. *HttpRequest* provides several methods, which can be used for payload access. At the same time *Payload* implements *Stream* trait, so it could be used with various stream combinators. Also *Payload* provides serveral convinience methods that return diff --git a/src/payload.rs b/src/payload.rs index 57dd7cf03..eda81c755 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -43,10 +43,12 @@ impl fmt::Debug for PayloadItem { } } -/// Stream of byte chunks +/// Buffered stream of bytes chunks /// -/// Payload stores chunks in vector. First chunk can be received with `.readany()` method. +/// Payload stores chunks in a vector. First chunk can be received with `.readany()` method. /// Payload stream is not thread safe. +/// +/// Payload stream can be used as `HttpResponse` body stream. #[derive(Debug)] pub struct Payload { inner: Rc>, @@ -128,7 +130,7 @@ impl Payload { self.inner.borrow_mut().set_buffer_size(size) } - /// Convert payload into BodyStream + /// Convert payload into compatible `HttpResponse` body stream pub fn stream(self) -> BodyStream { Box::new(self.map_err(|e| e.into())) }