settings.rs
Rust test marker or harnessimports http::StatusCode
SHA-256167f5640d27f35379be2b8faf397e4741c6cca863d0247e139058b114bc1499e
MaleculeH₂(CmOs)Md₂(In₃Pa)
Evidence
1use std::cell::{RefCell, RefMut, UnsafeCell};
2use std::collections::VecDeque;
3use std::fmt::Write;
4use std::rc::Rc;
5use std::time::{Duration, Instant};
6use std::{env, fmt, net};
7
8use actix::Arbiter;
9use bytes::BytesMut;
10use futures::Stream;
11use futures_cpupool::CpuPool;
12use http::StatusCode;
13use lazycell::LazyCell;
14use parking_lot::Mutex;
15use time;
16use tokio_timer::Interval;
17
18use super::channel::Node;
19use super::message::{Request, RequestPool};
20use super::server::{ConnectionRateTag, ConnectionTag, Connections};
21use super::KeepAlive;
22use body::Body;
23use httpresponse::{HttpResponse, HttpResponseBuilder, HttpResponsePool};
24
25/// Env variable for default cpu pool size
26const ENV_CPU_POOL_VAR: &str = "ACTIX_CPU_POOL";
27
28lazy_static! {
29 …
29:27… DEFAULT_CPUPOOL: Mutex<CpuPool> = {
30 let default = match env::var(ENV_CPU_POOL_VAR) {
31 Ok(val) => {
32 if let Ok(val) = val.parse() {
33 val
34 …
69:9… addr: None,
70 secure: false,
71 host: "localhost:8080".to_owned(),
72 responses: HttpResponsePool::get_pool(),
73 cpu_pool: LazyCell::new(),
74 }
75 }
76} …
97:13… responses,
98 }
99 }
100
101 /// Returns the socket address of the local half of this TCP connection
102 pub fn local_addr(&self) -> Option<net::SocketAddr> {
103 self.addr
104 …
⋯4 lines
301}
302
303#[cfg(test)]
304mod tests {
305 use super::*;
306
307 #[test]
308 fn test_date_len() {
309 assert_eq!(DATE_VALUE_LENGTH, "Sun, 06 Nov 1994 08:49:37 GMT".len());
⋯4 lines