1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-11 09:49:29 +00:00

update api doc example for client and add panic info for connection_info

This commit is contained in:
Nikolay Kim 2019-07-11 14:40:37 +06:00
parent f410f3330f
commit 69456991f6
2 changed files with 4 additions and 1 deletions

View file

@ -1,7 +1,7 @@
//! An HTTP Client
//!
//! ```rust
//! # use futures::future::{Future, lazy};
//! use futures::future::{lazy, Future};
//! use actix_rt::System;
//! use awc::Client;
//!

View file

@ -186,6 +186,9 @@ impl HttpRequest {
}
/// Get *ConnectionInfo* for the current request.
///
/// This method panics if request's extensions container is already
/// borrowed.
#[inline]
pub fn connection_info(&self) -> Ref<ConnectionInfo> {
ConnectionInfo::get(self.head(), &*self.app_config())