mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 01:32:57 +01:00
fix typos
This commit is contained in:
parent
f3b853f224
commit
4f6145e5c7
@ -122,7 +122,7 @@ fn index(req: HttpRequest) -> HttpResponse {
|
|||||||
|
|
||||||
## Streaming request
|
## 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.
|
*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
|
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
|
stream combinators. Also *Payload* provides serveral convinience methods that return
|
||||||
|
@ -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 is not thread safe.
|
||||||
|
///
|
||||||
|
/// Payload stream can be used as `HttpResponse` body stream.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Payload {
|
pub struct Payload {
|
||||||
inner: Rc<RefCell<Inner>>,
|
inner: Rc<RefCell<Inner>>,
|
||||||
@ -128,7 +130,7 @@ impl Payload {
|
|||||||
self.inner.borrow_mut().set_buffer_size(size)
|
self.inner.borrow_mut().set_buffer_size(size)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert payload into BodyStream
|
/// Convert payload into compatible `HttpResponse` body stream
|
||||||
pub fn stream(self) -> BodyStream {
|
pub fn stream(self) -> BodyStream {
|
||||||
Box::new(self.map_err(|e| e.into()))
|
Box::new(self.map_err(|e| e.into()))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user