1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-03-10 16:12:38 +01:00

62 lines
1.7 KiB
Rust
Raw Normal View History

2022-07-31 15:10:22 +01:00
use serde::Deserialize;
mod address;
mod backlog;
mod keep_alive;
mod max_connection_rate;
mod max_connections;
mod mode;
mod num_workers;
mod timeout;
mod tls;
2022-09-11 21:55:40 +01:00
pub use self::{
address::Address, backlog::Backlog, keep_alive::KeepAlive,
max_connection_rate::MaxConnectionRate, max_connections::MaxConnections, mode::Mode,
num_workers::NumWorkers, timeout::Timeout, tls::Tls,
};
/// Settings types for Actix Web.
2022-07-31 15:10:22 +01:00
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct ActixSettings {
2022-07-31 21:12:19 +02:00
/// List of addresses for the server to bind to.
pub hosts: Vec<Address>,
2022-07-31 21:12:19 +02:00
/// Marker of intended deployment environment.
pub mode: Mode,
/// True if the [`Compress`](actix_web::middleware::Compress) middleware should be enabled.
pub enable_compression: bool,
2022-07-31 21:12:19 +02:00
/// True if the [`Logger`](actix_web::middleware::Logger) middleware should be enabled.
pub enable_log: bool,
2022-07-31 21:12:19 +02:00
/// The number of workers that the server should start.
pub num_workers: NumWorkers,
2022-07-31 21:12:19 +02:00
/// The maximum number of pending connections.
pub backlog: Backlog,
2022-07-31 21:12:19 +02:00
/// The per-worker maximum number of concurrent connections.
pub max_connections: MaxConnections,
2022-07-31 21:12:19 +02:00
/// The per-worker maximum concurrent TLS connection limit.
pub max_connection_rate: MaxConnectionRate,
2022-07-31 21:12:19 +02:00
/// Server keep-alive preference.
pub keep_alive: KeepAlive,
2022-07-31 21:12:19 +02:00
/// Timeout duration for reading client request header.
pub client_timeout: Timeout,
2022-07-31 21:12:19 +02:00
/// Timeout duration for connection shutdown.
pub client_shutdown: Timeout,
2022-07-31 21:12:19 +02:00
/// Timeout duration for graceful worker shutdown.
pub shutdown_timeout: Timeout,
2022-07-31 21:12:19 +02:00
/// TLS (HTTPS) configuration.
pub tls: Tls,
}