From bb11fb3d242477ad0d61458b4c1dca7b146b4f3c Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 9 Apr 2018 21:57:40 -0700 Subject: [PATCH] update client mod doc string --- src/client/mod.rs | 29 ++++++++++++++++++++++++++++- src/fs.rs | 4 +--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/client/mod.rs b/src/client/mod.rs index 89b8bdeae..afe4e4595 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -1,4 +1,31 @@ -//! HTTP client +//! Http client api +//! +//! ```rust +//! # extern crate actix; +//! # extern crate actix_web; +//! # extern crate futures; +//! # use futures::Future; +//! use actix_web::client; +//! +//! fn main() { +//! let sys = actix::System::new("test"); +//! +//! actix::Arbiter::handle().spawn({ +//! client::get("http://www.rust-lang.org") // <- Create request builder +//! .header("User-Agent", "Actix-web") +//! .finish().unwrap() +//! .send() // <- Send http request +//! .map_err(|_| ()) +//! .and_then(|response| { // <- server http response +//! println!("Response: {:?}", response); +//! # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0)); +//! Ok(()) +//! }) +//! }); +//! +//! sys.run(); +//! } +//! ``` mod connector; mod parser; mod request; diff --git a/src/fs.rs b/src/fs.rs index e526ffbc0..2f8f4b4e6 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -1,6 +1,4 @@ -//! Static files support. - -// //! TODO: needs to re-implement actual files handling, current impl blocks +//! Static files support use std::{io, cmp}; use std::io::{Read, Seek}; use std::fmt::Write;