1 // rustfmt-wrap_comments: true
2 // rustfmt-max_width: 89
4 // Code block in doc comments that will exceed max width.
6 /// extern crate actix_web;
7 /// use actix_web::{actix, server, App, HttpResponse};
10 /// // Run actix system, this method actually starts all async processes
11 /// actix::System::run(|| {
12 /// server::new(|| App::new().resource("/", |r| r.h(|_| HttpResponse::Ok())))
13 /// .bind("127.0.0.1:0")
14 /// .expect("Can not bind to 127.0.0.1:0")
16 /// # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
22 // Code block in doc comments without the closing '```'.
24 /// # extern crate actix_web;
25 /// use actix_web::{App, HttpResponse, http};
28 /// let app = App::new()
30 /// "/", |r| r.method(http::Method::GET).f(|r| HttpResponse::Ok()))
37 /// # use std::thread;
38 /// # extern crate actix_web;
39 /// use actix_web::{server, App, HttpResponse};
46 /// # thread::spawn(|| {
49 /// App::with_state(State1)
51 /// .resource("/", |r| r.f(|r| HttpResponse::Ok()))
53 /// App::with_state(State2)
55 /// .resource("/", |r| r.f(|r| HttpResponse::Ok()))
59 /// .bind("127.0.0.1:8080")