mirror of
https://github.com/actix/actix-web.git
synced 2024-11-26 03:21:08 +00:00
doc tweaks
This commit is contained in:
parent
cea44be670
commit
551a0d973c
3 changed files with 5 additions and 4 deletions
|
@ -7,10 +7,10 @@ use h2::RecvStream;
|
||||||
|
|
||||||
use crate::error::PayloadError;
|
use crate::error::PayloadError;
|
||||||
|
|
||||||
/// Type represent boxed payload
|
/// A boxed payload.
|
||||||
pub type PayloadStream = Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>>>>;
|
pub type PayloadStream = Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>>>>;
|
||||||
|
|
||||||
/// Type represent streaming payload
|
/// A streaming payload.
|
||||||
pub enum Payload<S = PayloadStream> {
|
pub enum Payload<S = PayloadStream> {
|
||||||
None,
|
None,
|
||||||
H1(crate::h1::Payload),
|
H1(crate::h1::Payload),
|
||||||
|
|
|
@ -22,6 +22,7 @@ use crate::{
|
||||||
type Guards = Vec<Box<dyn Guard>>;
|
type Guards = Vec<Box<dyn Guard>>;
|
||||||
|
|
||||||
/// Service factory to convert `Request` to a `ServiceRequest<S>`.
|
/// Service factory to convert `Request` to a `ServiceRequest<S>`.
|
||||||
|
///
|
||||||
/// It also executes data factories.
|
/// It also executes data factories.
|
||||||
pub struct AppInit<T, B>
|
pub struct AppInit<T, B>
|
||||||
where
|
where
|
||||||
|
|
|
@ -349,7 +349,7 @@ impl Drop for HttpRequest {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// if possible, contribute to current worker's HttpRequest allocation pool
|
// if possible, contribute to current worker's HttpRequest allocation pool
|
||||||
|
|
||||||
// This relies on no Weak<HttpRequestInner> exists anywhere. (There is none.)
|
// This relies on no weak references to inner existing anywhere within the codebase.
|
||||||
if let Some(inner) = Rc::get_mut(&mut self.inner) {
|
if let Some(inner) = Rc::get_mut(&mut self.inner) {
|
||||||
if inner.app_state.pool().is_available() {
|
if inner.app_state.pool().is_available() {
|
||||||
// clear additional app_data and keep the root one for reuse.
|
// clear additional app_data and keep the root one for reuse.
|
||||||
|
@ -360,7 +360,7 @@ impl Drop for HttpRequest {
|
||||||
Rc::get_mut(&mut inner.req_data).unwrap().get_mut().clear();
|
Rc::get_mut(&mut inner.req_data).unwrap().get_mut().clear();
|
||||||
|
|
||||||
// a re-borrow of pool is necessary here.
|
// a re-borrow of pool is necessary here.
|
||||||
let req = self.inner.clone();
|
let req = Rc::clone(&self.inner);
|
||||||
self.app_state().pool().push(req);
|
self.app_state().pool().push(req);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue