<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="Easily manage Actix Web’s settings from a TOML file and environment variables."><metaname="keywords"content="rust, rustlang, rust-lang, actix_settings"><title>actix_settings - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../static.files/rustdoc-9e69e4c014d22d53.css"id="mainThemeStyle"><linkrel="stylesheet"id="themeStyle"href="../static.files/light-4743e13df3dfe8c4.css"><linkrel="stylesheet"disabledhref="../static.files/dark-0e1b889528bd466b.css"><linkrel="stylesheet"disabledhref="../static.files/ayu-65289d5d067c7c66.css"><scriptid="default-settings"></script><scriptsrc="../static.files/storage-d43fa987303ecbbb.js"></script><scriptdefersrc="../crates.js"></script><scriptdefersrc="../static.files/main-4a084badb5778746.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-13285aec31fa243e.css"></noscript><linkrel="icon"href="https://actix.rs/favicon.ico"></head><bodyclass="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="sidebar-logo"href="../actix_settings/index.html"><divclass="logo-container"><imgsrc="https://actix.rs/img/logo.png"alt="logo"></div></a><h2></h2></nav><navclass="sidebar"><aclass="sidebar-logo"href="../actix_settings/index.html"><divclass="logo-container">
<imgsrc="https://actix.rs/img/logo.png"alt="logo"></div></a><h2class="location"><ahref="#">Crate actix_settings</a></h2><divclass="sidebar-elems"><ulclass="block"><liclass="version">Version 0.6.0</li><li><aid="all-types"href="all.html">All Items</a></li></ul><section><ulclass="block"><li><ahref="#structs">Structs</a></li><li><ahref="#enums">Enums</a></li><li><ahref="#traits">Traits</a></li><li><ahref="#types">Type Definitions</a></li></ul></section></div></nav><main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"title="help"tabindex="-1"><ahref="../help.html">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../static.files/wheel-5ec35bf9ca753509.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1class="fqn">Crate <aclass="mod"href="#">actix_settings</a><buttonid="copy-path"onclick="copy_path(this)"title="Copy item path to clipboard"><imgsrc="../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="srclink"href="../src/actix_settings/lib.rs.html#1-811">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Easily manage Actix Web’s settings from a TOML file and environment variables.</p>
<p>To get started add a <ahref="struct.BasicSettings.html#method.parse_toml"><code>Settings::parse_toml("./Server.toml")</code></a> call to the
top of your main function. This will create a template file with descriptions of all the
configurable settings. You can change or remove anything in that file and it will be picked up
the next time you run your application.</p>
<p>Overriding parts of the file can be done from values using <ahref="struct.BasicSettings.html#method.override_field"title="Settings::override_field"><code>Settings::override_field</code></a> or from
the environment using <ahref="struct.BasicSettings.html#method.override_field_with_env_var"title="Settings::override_field_with_env_var"><code>Settings::override_field_with_env_var</code></a>.</p>
</div></details><h2id="structs"class="small-section-header"><ahref="#structs">Structs</a></h2><divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ActixSettings.html"title="actix_settings::ActixSettings struct">ActixSettings</a></div><divclass="item-right docblock-short">Settings types for Actix Web.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Address.html"title="actix_settings::Address struct">Address</a></div><divclass="item-right docblock-short">A host/port pair for the server to bind to.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.BasicSettings.html"title="actix_settings::BasicSettings struct">BasicSettings</a></div><divclass="item-right docblock-short">Wrapper for server and application-specific settings.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.NoSettings.html"title="actix_settings::NoSettings struct">NoSettings</a></div><divclass="item-right docblock-short">Marker type representing no defined application-specific settings.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Tls.html"title="actix_settings::Tls struct">Tls</a></div><divclass="item-right docblock-short">TLS (HTTPS) configuration.</div></div></div><h2id="enums"class="small-section-header"><ahref="#enums">Enums</a></h2><divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.Backlog.html"title="actix_settings::Backlog enum">Backlog</a></div><divclass="item-right docblock-short">The maximum number of pending connections.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.Error.html"title="actix_settings::Error enum">Error</a></div><divclass="item-right docblock-short">Errors that can be returned from methods in this crate.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.KeepAlive.html"title="actix_settings::KeepAlive enum">KeepAlive</a></div><divclass="item-right docblock-short">The server keep-alive preference.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.MaxConnectionRate.html"title="actix_settings::MaxConnectionRate enum">MaxConnectionRate</a></div><divclass="item-right docblock-short">The maximum per-worker concurrent TLS connection limit.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.MaxConnections.html"title="actix_settings::MaxConnections enum">MaxConnections</a></div><divclass="item-right docblock-short">The maximum per-worker number of concurrent connections.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.Mode.html"title="actix_settings::Mode enum">Mode</a></div><divclass="item-right docblock-short">Marker of intended deployment environment.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.NumWorkers.html"title="actix_settings::NumWorkers enum">NumWorkers</a></div><divclass="item-right docblock-short">The number of workers that the server should start.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.Timeout.html"title="actix_settings::Timeout enum">Timeout</a></div><divclass="item-right docblock-short">A timeout duration in milliseconds or seconds.</div></div></div><h2id="traits"class="small-section-header"><ahref="#traits">Traits</a></h2><divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="trait"href="trait.ApplySettings.html"title="actix_settings::ApplySettings trait">ApplySettings</a></div><divclass="item-right docblock-short">Extension trait for applying parsed settings to the server object.</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="trait"href="trait.Parse.html"title="actix_settings::