mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 16:02:59 +01:00
fix doc string
This commit is contained in:
parent
34fd9f8148
commit
dde266b9ef
@ -288,8 +288,10 @@ impl ClientConnector {
|
|||||||
/// # extern crate actix;
|
/// # extern crate actix;
|
||||||
/// # extern crate actix_web;
|
/// # extern crate actix_web;
|
||||||
/// # extern crate futures;
|
/// # extern crate futures;
|
||||||
|
/// # extern crate tokio;
|
||||||
/// # use futures::Future;
|
/// # use futures::Future;
|
||||||
/// # use std::io::Write;
|
/// # use std::io::Write;
|
||||||
|
/// # use std::process;
|
||||||
/// extern crate openssl;
|
/// extern crate openssl;
|
||||||
/// use actix::prelude::*;
|
/// use actix::prelude::*;
|
||||||
/// use actix_web::client::{Connect, ClientConnector};
|
/// use actix_web::client::{Connect, ClientConnector};
|
||||||
@ -297,13 +299,12 @@ impl ClientConnector {
|
|||||||
/// use openssl::ssl::{SslMethod, SslConnector};
|
/// use openssl::ssl::{SslMethod, SslConnector};
|
||||||
///
|
///
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
/// let sys = System::new("test");
|
/// tokio::run(future::lazy(||
|
||||||
///
|
///
|
||||||
/// // Start `ClientConnector` with custom `SslConnector`
|
/// // Start `ClientConnector` with custom `SslConnector`
|
||||||
/// let ssl_conn = SslConnector::builder(SslMethod::tls()).unwrap().build();
|
/// let ssl_conn = SslConnector::builder(SslMethod::tls()).unwrap().build();
|
||||||
/// let conn = ClientConnector::with_connector(ssl_conn).start();
|
/// let conn = ClientConnector::with_connector(ssl_conn).start();
|
||||||
///
|
///
|
||||||
/// Arbiter::spawn(
|
|
||||||
/// conn.send(
|
/// conn.send(
|
||||||
/// Connect::new("https://www.rust-lang.org").unwrap()) // <- connect to host
|
/// Connect::new("https://www.rust-lang.org").unwrap()) // <- connect to host
|
||||||
/// .map_err(|_| ())
|
/// .map_err(|_| ())
|
||||||
@ -311,12 +312,10 @@ impl ClientConnector {
|
|||||||
/// if let Ok(mut stream) = res {
|
/// if let Ok(mut stream) = res {
|
||||||
/// stream.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap();
|
/// stream.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap();
|
||||||
/// }
|
/// }
|
||||||
/// # Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
/// # process::exit(0);
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// })
|
/// })
|
||||||
/// );
|
/// );
|
||||||
///
|
|
||||||
/// sys.run();
|
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn with_connector(connector: SslConnector) -> ClientConnector {
|
pub fn with_connector(connector: SslConnector) -> ClientConnector {
|
||||||
|
Loading…
Reference in New Issue
Block a user