<!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="Convenience type alias for `BasicSettings` with no defined application-specific settings."><title>Settings in actix_settings - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../static.files/SourceSerif4-Regular-46f98efaafac5295.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-a2c9cd1067f8b328.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-fa3bb1812debf86c.css"><metaname="rustdoc-vars"data-root-path="../"data-static-root-path="../static.files/"data-current-crate="actix_settings"data-themes=""data-resource-suffix=""data-rustdoc-version="1.75.0-nightly (bf9a1c8a1 2023-10-08)"data-channel="nightly"data-search-js="search-5f5ec5419eadd0c9.js"data-settings-js="settings-74424d7eec62a23e.js"><scriptsrc="../static.files/storage-fec3eaa3851e447d.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../static.files/main-c5bd66d33317d69f.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><linkrel="icon"href="https://actix.rs/favicon.ico"></head><bodyclass="rustdoc type"><!--[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="logo-container"href="../actix_settings/index.html"><imgsrc="https://actix.rs/img/logo.png"alt="logo"></a></nav><navclass="sidebar"><aclass="logo-container"href="../actix_settings/index.html"><imgsrc="https://actix.rs/img/logo.png"alt="logo"></a><h2class="location"><ahref="#">Settings</a></h2><divclass="sidebar-elems"><section><h3><ahref="#aliased-type">Aliased type</a></h3><h3><ahref="#fields">Fields</a></h3><ulclass="block"><li><ahref="#structfield.actix">actix</a></li><li><ahref="#structfield.application">application</a></li></ul><h3><ahref="#implementations">Methods</a></h3><ulclass="block"><li><ahref="#method.from_default_template">from_default_template</a></li><li><ahref="#method.from_template">from_template</a></li><li><ahref="#method.override_field">override_field</a></li><li><ahref="#method.override_field_with_env_var">override_field_with_env_var</a></li><li><ahref="#method.parse_toml">parse_toml</a></li><li><ahref="#method.write_toml_file">write_toml_file</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block"><li><ahref="#impl-Clone-for-BasicSettings%3CA%3E">Clone</a></li><li><ahref="#impl-Debug-for-BasicSettings%3CA%3E">Debug</a></li><li><ahref="#impl-Deserialize%3C'de%3E-for-BasicSettings%3CA%3E">Deserialize<'de></a></li><li><ahref="#impl-Eq-for-BasicSettings%3CA%3E">Eq</a></li><li><ahref="#impl-Hash-for-BasicSettings%3CA%3E">Hash</a></li><li><ahref="#impl-PartialEq%3CBasicSettings%3CA%3E%3E-for-BasicSettings%3CA%3E">PartialEq<BasicSettings<A>></a></li><li><ahref="#impl-StructuralEq-for-BasicSettings%3CA%3E">StructuralEq</a></li><li><ahref="#impl-StructuralPartialEq-for-BasicSettings%3CA%3E">StructuralPartialEq</a></li></ul></section><h2><ahref="index.html">In actix_settings</a></h2></div></nav><main><divclass="width-limiter"><navclass="sub"><formclass="search
}</code></pre><h2id="fields"class="fields small-section-header">Fields<ahref="#fields"class="anchor">§</a></h2><spanid="structfield.actix"class="structfield small-section-header"><ahref="#structfield.actix"class="anchor field">§</a><code>actix: <aclass="struct"href="struct.ActixSettings.html"title="struct actix_settings::ActixSettings">ActixSettings</a></code></span><divclass="docblock"><p>Actix Web server settings.</p>
P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html"title="struct std::path::Path">Path</a>>,</span></h4></section></summary><divclass="docblock"><p>Parse an instance of <code>Self</code> from a TOML file located at <code>filepath</code>.</p>
<p>If the file doesn’t exist, it is generated from the default TOML template, after which the
newly generated file is read in and parsed.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.from_default_template"class="method"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#159-161">source</a><h4class="code-header">pub fn <ahref="#method.from_default_template"class="fn">from_default_template</a>() -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><Self, <aclass="enum"href="enum.Error.html"title="enum actix_settings::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Parse an instance of <code>Self</code> straight from the default TOML template.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.from_template"class="method"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#165-167">source</a><h4class="code-header">pub fn <ahref="#method.from_template"class="fn">from_template</a>(template: &<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><Self, <aclass="enum"href="enum.Error.html"title="enum actix_settings::Error">Error</a>></h4></section></summary><divclass="docblock"><p>Parse an instance of <code>Self</code> straight from the default TOML template.</p>
P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html"title="struct std::path::Path">Path</a>>,</span></h4></section></summary><divclass="docblock"><p>Writes the default TOML template to a new file, located at <code>filepath</code>.</p>
<p>Returns a <ahref="enum.Error.html#variant.FileExists"title="variant actix_settings::Error::FileExists"><code>FileExists</code></a> error if a file already exists at that
V: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>,</span></h4></section></summary><divclass="docblock"><p>Attempts to parse <code>value</code> and override the referenced <code>field</code>.</p>
N: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>,</span></h4></section></summary><divclass="docblock"><p>Attempts to read an environment variable, parse it, and override the referenced <code>field</code>.</p>
__D: <aclass="trait"href="https://docs.rs/serde/1.0.188/serde/de/trait.Deserializer.html"title="trait serde::de::Deserializer">Deserializer</a><'de>,</span></h4></section></summary><divclass='docblock'>Deserialize this value from the given Serde deserializer. <ahref="https://docs.rs/serde/1.0.188/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Hash-for-BasicSettings%3CA%3E"class="impl"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#105">source</a><ahref="#impl-Hash-for-BasicSettings%3CA%3E"class="anchor">§</a><h3class="code-header">impl<A: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a>><aclass="trait"href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html"title="trait core::hash::Hash">Hash</a> for <aclass="struct"href="struct.BasicSettings.html"title="struct actix_settings::BasicSettings">BasicSettings</a><A></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.hash"class="method trait-impl"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#105">source</a><ahref="#method.hash"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash"class="fn">hash</a><__H: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html"title="trait core::hash::Hasher">Hasher</a>>(&self, state: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut __H</a>)</h4></section></summary><divclass='docblock'>Feeds this value into the given <ahref="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html"title="trait core::hash::Hasher"><code>Hasher</code></a>. <ahref="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.hash_slice"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.3.0">1.3.0</span> · <aclass="src"href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#242-244">source</a></span><ahref="#method.hash_slice"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice"class="fn">hash_slice</a><H>(data: &<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[Self]</a>, state: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut H</a>)<spanclass="where fmt-newline">where
Self: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</span></h4></section></summary><divclass='docblock'>Feeds a slice of this type into the given <ahref="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html"title="trait core::hash::Hasher"><code>Hasher</code></a>. <ahref="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CBasicSettings%3CA%3E%3E-for-BasicSettings%3CA%3E"class="impl"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#105">source</a><ahref="#impl-PartialEq%3CBasicSettings%3CA%3E%3E-for-BasicSettings%3CA%3E"class="anchor">§</a><h3class="code-header">impl<A: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a>><aclass="trait"href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="struct.BasicSettings.html"title="struct actix_settings::BasicSettings">BasicSettings</a><A>> for <aclass="struct"href="struct.BasicSettings.html"title="struct actix_settings::BasicSettings">BasicSettings</a><A></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq"class="method trait-impl"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#105">source</a><ahref="#method.eq"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="struct.BasicSettings.html"title="struct actix_settings::BasicSettings">BasicSettings</a><A>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#239">source</a></span><ahref="#method.ne"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><sectionid="impl-Eq-for-BasicSettings%3CA%3E"class="impl"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#105">source</a><ahref="#impl-Eq-for-BasicSettings%3CA%3E"class="anchor">§</a><h3class="code-header">impl<A: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html"title="trait core::cmp::Eq">Eq</a>><aclass="trait"href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html"title="trait core::cmp::Eq">Eq</a> for <aclass="struct"href="struct.BasicSettings.html"title="struct actix_settings::BasicSettings">BasicSettings</a><A></h3></section><sectionid="impl-StructuralEq-for-BasicSettings%3CA%3E"class="impl"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#105">source</a><ahref="#impl-StructuralEq-for-BasicSettings%3CA%3E"class="anchor">§</a><h3class="code-header">impl<A><aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html"title="trait core::marker::StructuralEq">StructuralEq</a> for <aclass="struct"href="struct.BasicSettings.html"title="struct actix_settings::BasicSettings">BasicSettings</a><A></h3></section><sectionid="impl-StructuralPartialEq-for-BasicSettings%3CA%3E"class="impl"><aclass="src rightside"href="../src/actix_settings/lib.rs.html#105">source</a><ahref="#impl-StructuralPartialEq-for-BasicSettings%3CA%3E"class="anchor">§</a><h3class="code-header">impl<A><aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html"title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <aclass="struct"href="struct.BasicSettings.html"title="struct actix_settings::BasicSettings">BasicSettings</a><A></h3></section></div></section></div></main></body></html>