mirror of
https://github.com/actix/actix-extras.git
synced 2025-08-31 03:20:20 +02:00
Deploying to gh-pages from @ 8741cd32cc
🚀
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Errors that can occur when processing CORS guarded requests."><meta name="keywords" content="rust, rustlang, rust-lang, CorsError"><title>actix_cors::CorsError - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="https://actix.rs/favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../actix_cors/index.html'><div class='logo-container'><img src='https://actix.rs/img/logo.png' alt='logo'></div></a><p class="location">Enum CorsError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.BadRequestHeaders">BadRequestHeaders</a><a href="#variant.BadRequestMethod">BadRequestMethod</a><a href="#variant.HeadersNotAllowed">HeadersNotAllowed</a><a href="#variant.MethodNotAllowed">MethodNotAllowed</a><a href="#variant.MissingOrigin">MissingOrigin</a><a href="#variant.MissingRequestMethod">MissingRequestMethod</a><a href="#variant.OriginNotAllowed">OriginNotAllowed</a><a href="#variant.WildcardOrigin">WildcardOrigin</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-ResponseError">ResponseError</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="index.html">actix_cors</a></p><div id="sidebar-vars" data-name="CorsError" data-ty="enum" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="index.html">actix_cors</a>::<wbr><a class="enum" href="">CorsError</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/actix_cors/error.rs.html#8-46" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum"><span class="docblock attributes top-attr">#[non_exhaustive]</span>pub enum CorsError {
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="index.html">actix_cors</a>::<wbr><a class="enum" href="">CorsError</a><button id="copy-path" onclick="copy_path(this)">⎘</button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/actix_cors/error.rs.html#8-46" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum"><span class="docblock attributes top-attr">#[non_exhaustive]</span>pub enum CorsError {
|
||||
WildcardOrigin,
|
||||
MissingOrigin,
|
||||
MissingRequestMethod,
|
||||
@@ -23,11 +23,11 @@
|
||||
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../src/actix_cors/error.rs.html#6" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/actix_cors/error.rs.html#6" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../src/actix_cors/error.rs.html#6" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&self, _derive_more_display_formatter: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/actix_cors/error.rs.html#6" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id="impl-Error" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-Error" class="anchor"></a><a class="srclink" href="../src/actix_cors/error.rs.html#6" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source" class="fnname">source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#99" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
|
||||
</div><h4 id="method.backtrace" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace" class="fnname">backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#127" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
|
||||
</div><h4 id="method.description" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description" class="fnname">description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#139" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
|
||||
</div></div><div class='docblock hidden'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause" class="fnname">cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#149" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
|
||||
</div></div></div><h3 id="impl-ResponseError" class="impl"><code class="in-band">impl ResponseError for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-ResponseError" class="anchor"></a><a class="srclink" href="../src/actix_cors/error.rs.html#48-56" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.status_code" class="method hidden"><code>fn <a href="#method.status_code" class="fnname">status_code</a>(&self) -> <a class="struct" href="https://docs.rs/http/0.2.3/http/status/struct.StatusCode.html" title="struct http::status::StatusCode">StatusCode</a></code><a class="srclink" href="../src/actix_cors/error.rs.html#49-51" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Response’s status code <a href="#method.status_code">Read more</a></p>
|
||||
</div></div><h3 id="impl-Error" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-Error" class="anchor"></a><a class="srclink" href="../src/actix_cors/error.rs.html#6" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source" class="fnname">source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#106" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
|
||||
</div><h4 id="method.backtrace" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace" class="fnname">backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#134" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
|
||||
</div><h4 id="method.description" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description" class="fnname">description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#146" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
|
||||
</div></div><div class='docblock hidden'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause" class="fnname">cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#156" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
|
||||
</div></div></div><h3 id="impl-ResponseError" class="impl"><code class="in-band">impl ResponseError for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-ResponseError" class="anchor"></a><a class="srclink" href="../src/actix_cors/error.rs.html#48-56" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.status_code" class="method hidden"><code>fn <a href="#method.status_code" class="fnname">status_code</a>(&self) -> <a class="struct" href="https://docs.rs/http/0.2.4/http/status/struct.StatusCode.html" title="struct http::status::StatusCode">StatusCode</a></code><a class="srclink" href="../src/actix_cors/error.rs.html#49-51" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Response’s status code <a href="#method.status_code">Read more</a></p>
|
||||
</div><h4 id="method.error_response" class="method hidden"><code>fn <a href="#method.error_response" class="fnname">error_response</a>(&self) -> HttpResponse</code><a class="srclink" href="../src/actix_cors/error.rs.html#53-55" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Create response for error <a href="#method.error_response">Read more</a></p>
|
||||
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="enum" href="../actix_cors/enum.CorsError.html" title="enum actix_cors::CorsError">CorsError</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
|
@@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Cross-Origin Resource Sharing (CORS) controls for Actix Web."><meta name="keywords" content="rust, rustlang, rust-lang, actix_cors"><title>actix_cors - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="https://actix.rs/favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../actix_cors/index.html'><div class='logo-container'><img src='https://actix.rs/img/logo.png' alt='logo'></div></a><p class="location">Crate actix_cors</p><div class="block version"><p>Version 0.6.0-beta.1</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all actix_cors's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class="location"></p><div id="sidebar-vars" data-name="actix_cors" data-ty="mod" data-relpath="../"></div></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">actix_cors</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/actix_cors/lib.rs.html#1-60" title="goto source code">[src]</a></span></h1><div class="docblock"><p>Cross-Origin Resource Sharing (CORS) controls for Actix Web.</p>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">actix_cors</a><button id="copy-path" onclick="copy_path(this)">⎘</button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/actix_cors/lib.rs.html#1-60" title="goto source code">[src]</a></span></h1><div class="docblock"><p>Cross-Origin Resource Sharing (CORS) controls for Actix Web.</p>
|
||||
<p>This middleware can be applied to both applications and resources. Once built, a
|
||||
<a href="../actix_cors/struct.Cors.html" title="Cors"><code>Cors</code></a> builder can be used as an argument for Actix Web’s <code>App::wrap()</code>,
|
||||
<code>Scope::wrap()</code>, or <code>Resource::wrap()</code> methods.</p>
|
||||
<p>This CORS middleware automatically handles <code>OPTIONS</code> preflight requests.</p>
|
||||
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">actix_cors</span>::<span class="ident">Cors</span>;
|
||||
<span class="kw">use</span> <span class="ident">actix_cors::Cors</span>;
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">get</span>, <span class="ident">http</span>, <span class="ident">web</span>, <span class="ident">App</span>, <span class="ident">HttpRequest</span>, <span class="ident">HttpResponse</span>, <span class="ident">HttpServer</span>};
|
||||
|
||||
<span class="attribute">#[<span class="ident">get</span>(<span class="string">"/index.html"</span>)]</span>
|
||||
@@ -14,20 +14,20 @@
|
||||
<span class="string">"<p>Hello World!</p>"</span>
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">actix_web</span>::<span class="ident">main</span>]</span>
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-</span><span class="op">></span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="ident">HttpServer</span>::<span class="ident">new</span>(<span class="op">|</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="ident">cors</span> <span class="op">=</span> <span class="ident">Cors</span>::<span class="ident">default</span>()
|
||||
<span class="attribute">#[<span class="ident">actix_web::main</span>]</span>
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-</span><span class="op">></span> <span class="ident">std::io::Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="ident">HttpServer::new</span>(<span class="op">|</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="ident">cors</span> <span class="op">=</span> <span class="ident">Cors::default</span>()
|
||||
.<span class="ident">allowed_origin</span>(<span class="string">"https://www.rust-lang.org/"</span>)
|
||||
.<span class="ident">allowed_origin_fn</span>(<span class="op">|</span><span class="ident">origin</span>, <span class="ident">_req_head</span><span class="op">|</span> {
|
||||
<span class="ident">origin</span>.<span class="ident">as_bytes</span>().<span class="ident">ends_with</span>(<span class="string">b".rust-lang.org"</span>)
|
||||
})
|
||||
.<span class="ident">allowed_methods</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="string">"GET"</span>, <span class="string">"POST"</span>])
|
||||
.<span class="ident">allowed_headers</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">http</span>::<span class="ident">header</span>::<span class="ident">AUTHORIZATION</span>, <span class="ident">http</span>::<span class="ident">header</span>::<span class="ident">ACCEPT</span>])
|
||||
.<span class="ident">allowed_header</span>(<span class="ident">http</span>::<span class="ident">header</span>::<span class="ident">CONTENT_TYPE</span>)
|
||||
.<span class="ident">allowed_methods</span>(<span class="macro">vec!</span>[<span class="string">"GET"</span>, <span class="string">"POST"</span>])
|
||||
.<span class="ident">allowed_headers</span>(<span class="macro">vec!</span>[<span class="ident">http::header::AUTHORIZATION</span>, <span class="ident">http::header::ACCEPT</span>])
|
||||
.<span class="ident">allowed_header</span>(<span class="ident">http::header::CONTENT_TYPE</span>)
|
||||
.<span class="ident">max_age</span>(<span class="number">3600</span>);
|
||||
|
||||
<span class="ident">App</span>::<span class="ident">new</span>()
|
||||
<span class="ident">App::new</span>()
|
||||
.<span class="ident">wrap</span>(<span class="ident">cors</span>)
|
||||
.<span class="ident">service</span>(<span class="ident">index</span>)
|
||||
})
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Builder for CORS middleware."><meta name="keywords" content="rust, rustlang, rust-lang, Cors"><title>actix_cors::Cors - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="https://actix.rs/favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../actix_cors/index.html'><div class='logo-container'><img src='https://actix.rs/img/logo.png' alt='logo'></div></a><p class="location">Struct Cors</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.allow_any_header">allow_any_header</a><a href="#method.allow_any_method">allow_any_method</a><a href="#method.allow_any_origin">allow_any_origin</a><a href="#method.allowed_header">allowed_header</a><a href="#method.allowed_headers">allowed_headers</a><a href="#method.allowed_methods">allowed_methods</a><a href="#method.allowed_origin">allowed_origin</a><a href="#method.allowed_origin_fn">allowed_origin_fn</a><a href="#method.disable_preflight">disable_preflight</a><a href="#method.disable_vary_header">disable_vary_header</a><a href="#method.expose_any_header">expose_any_header</a><a href="#method.expose_headers">expose_headers</a><a href="#method.max_age">max_age</a><a href="#method.permissive">permissive</a><a href="#method.send_wildcard">send_wildcard</a><a href="#method.supports_credentials">supports_credentials</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E">Transform<S, ServiceRequest></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="index.html">actix_cors</a></p><div id="sidebar-vars" data-name="Cors" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">actix_cors</a>::<wbr><a class="struct" href="">Cors</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/actix_cors/builder.rs.html#72-75" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Cors { /* fields omitted */ }</pre></div><div class="docblock"><p>Builder for CORS middleware.</p>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">actix_cors</a>::<wbr><a class="struct" href="">Cors</a><button id="copy-path" onclick="copy_path(this)">⎘</button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/actix_cors/builder.rs.html#72-75" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Cors { /* fields omitted */ }</pre></div><div class="docblock"><p>Builder for CORS middleware.</p>
|
||||
<p>To construct a CORS middleware, call <a href="../actix_cors/struct.Cors.html#method.default" title="Cors::default()"><code>Cors::default()</code></a> to create a blank, restrictive builder.
|
||||
Then use any of the builder methods to customize CORS behavior.</p>
|
||||
<p>The alternative <a href="../actix_cors/struct.Cors.html#method.permissive" title="Cors::permissive()"><code>Cors::permissive()</code></a> constructor is available for local development, allowing
|
||||
@@ -11,14 +11,14 @@ messages will outline what is wrong with the CORS configuration in the server lo
|
||||
server will fail to start up or serve requests.</p>
|
||||
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">actix_cors</span>::<span class="ident">Cors</span>;
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">http</span>::<span class="ident">header</span>;
|
||||
<span class="kw">use</span> <span class="ident">actix_cors::Cors</span>;
|
||||
<span class="kw">use</span> <span class="ident">actix_web::http::header</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">cors</span> <span class="op">=</span> <span class="ident">Cors</span>::<span class="ident">default</span>()
|
||||
<span class="kw">let</span> <span class="ident">cors</span> <span class="op">=</span> <span class="ident">Cors::default</span>()
|
||||
.<span class="ident">allowed_origin</span>(<span class="string">"https://www.rust-lang.org"</span>)
|
||||
.<span class="ident">allowed_methods</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="string">"GET"</span>, <span class="string">"POST"</span>])
|
||||
.<span class="ident">allowed_headers</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">header</span>::<span class="ident">AUTHORIZATION</span>, <span class="ident">header</span>::<span class="ident">ACCEPT</span>])
|
||||
.<span class="ident">allowed_header</span>(<span class="ident">header</span>::<span class="ident">CONTENT_TYPE</span>)
|
||||
.<span class="ident">allowed_methods</span>(<span class="macro">vec!</span>[<span class="string">"GET"</span>, <span class="string">"POST"</span>])
|
||||
.<span class="ident">allowed_headers</span>(<span class="macro">vec!</span>[<span class="ident">header::AUTHORIZATION</span>, <span class="ident">header::ACCEPT</span>])
|
||||
.<span class="ident">allowed_header</span>(<span class="ident">header::CONTENT_TYPE</span>)
|
||||
.<span class="ident">max_age</span>(<span class="number">3600</span>);
|
||||
|
||||
<span class="comment">// `cors` can now be used in `App::wrap`.</span></pre></div>
|
||||
@@ -45,7 +45,7 @@ allowed origins.</p>
|
||||
<li>If supplied origin is not valid uri</li>
|
||||
<li>If supplied origin is a wildcard (<code>*</code>). <a href="../actix_cors/struct.Cors.html#method.send_wildcard" title="Cors::send_wildcard"><code>Cors::send_wildcard</code></a> should be used instead.</li>
|
||||
</ul>
|
||||
</div><h4 id="method.allowed_origin_fn" class="method"><code>pub fn <a href="#method.allowed_origin_fn" class="fnname">allowed_origin_fn</a><F>(self, f: F) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="struct" href="https://docs.rs/http/0.2.3/http/header/value/struct.HeaderValue.html" title="struct http::header::value::HeaderValue">HeaderValue</a>, &RequestHead) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> + 'static, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#181-192" title="goto source code">[src]</a></h4><div class="docblock"><p>Determinate allowed origins by processing requests which didn’t match any origins specified
|
||||
</div><h4 id="method.allowed_origin_fn" class="method"><code>pub fn <a href="#method.allowed_origin_fn" class="fnname">allowed_origin_fn</a><F>(self, f: F) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="struct" href="https://docs.rs/http/0.2.4/http/header/value/struct.HeaderValue.html" title="struct http::header::value::HeaderValue">HeaderValue</a>, &RequestHead) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> + 'static, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#181-192" title="goto source code">[src]</a></h4><div class="docblock"><p>Determinate allowed origins by processing requests which didn’t match any origins specified
|
||||
in the <code>allowed_origin</code>.</p>
|
||||
<p>The function will receive two parameters, the Origin header value, and the <code>RequestHead</code> of
|
||||
each request, which can be used to determine whether to allow the request or not.</p>
|
||||
@@ -53,15 +53,15 @@ each request, which can be used to determine whether to allow the request or not
|
||||
into the <code>Access-Control-Allow-Origin</code> response header.</p>
|
||||
</div><h4 id="method.allow_any_method" class="method"><code>pub fn <a href="#method.allow_any_method" class="fnname">allow_any_method</a>(self) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a></code><a class="srclink" href="../src/actix_cors/builder.rs.html#197-203" title="goto source code">[src]</a></h4><div class="docblock"><p>Resets allowed methods list to all methods.</p>
|
||||
<p>See <a href="../actix_cors/struct.Cors.html#method.allowed_methods" title="Cors::allowed_methods"><code>Cors::allowed_methods</code></a> for more info on allowed methods.</p>
|
||||
</div><h4 id="method.allowed_methods" class="method"><code>pub fn <a href="#method.allowed_methods" class="fnname">allowed_methods</a><U, M>(self, methods: U) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = M>,<br> M: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/method/struct.Method.html" title="struct http::method::Method">Method</a>>,<br> <M as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/method/struct.Method.html" title="struct http::method::Method">Method</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>>, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#213-235" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a list of methods which allowed origins can perform.</p>
|
||||
</div><h4 id="method.allowed_methods" class="method"><code>pub fn <a href="#method.allowed_methods" class="fnname">allowed_methods</a><U, M>(self, methods: U) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = M>,<br> M: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/method/struct.Method.html" title="struct http::method::Method">Method</a>>,<br> <M as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/method/struct.Method.html" title="struct http::method::Method">Method</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>>, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#213-235" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a list of methods which allowed origins can perform.</p>
|
||||
<p>These will be sent in the <code>Access-Control-Allow-Methods</code> response header as specified in
|
||||
the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p>
|
||||
<p>Defaults to <code>[GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE]</code></p>
|
||||
</div><h4 id="method.allow_any_header" class="method"><code>pub fn <a href="#method.allow_any_header" class="fnname">allow_any_header</a>(self) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a></code><a class="srclink" href="../src/actix_cors/builder.rs.html#240-246" title="goto source code">[src]</a></h4><div class="docblock"><p>Resets allowed request header list to a state where any header is accepted.</p>
|
||||
<p>See <a href="../actix_cors/struct.Cors.html#method.allowed_headers" title="Cors::allowed_headers"><code>Cors::allowed_headers</code></a> for more info on allowed request headers.</p>
|
||||
</div><h4 id="method.allowed_header" class="method"><code>pub fn <a href="#method.allowed_header" class="fnname">allowed_header</a><H>(self, header: H) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>,<br> <H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>>, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#251-274" title="goto source code">[src]</a></h4><div class="docblock"><p>Add an allowed request header.</p>
|
||||
</div><h4 id="method.allowed_header" class="method"><code>pub fn <a href="#method.allowed_header" class="fnname">allowed_header</a><H>(self, header: H) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>,<br> <H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>>, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#251-274" title="goto source code">[src]</a></h4><div class="docblock"><p>Add an allowed request header.</p>
|
||||
<p>See <a href="../actix_cors/struct.Cors.html#method.allowed_headers" title="Cors::allowed_headers"><code>Cors::allowed_headers</code></a> for more info on allowed request headers.</p>
|
||||
</div><h4 id="method.allowed_headers" class="method"><code>pub fn <a href="#method.allowed_headers" class="fnname">allowed_headers</a><U, H>(self, headers: U) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = H>,<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>,<br> <H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>>, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#286-314" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a list of request header field names which can be used when this resource is accessed by
|
||||
</div><h4 id="method.allowed_headers" class="method"><code>pub fn <a href="#method.allowed_headers" class="fnname">allowed_headers</a><U, H>(self, headers: U) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = H>,<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>,<br> <H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>>, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#286-314" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a list of request header field names which can be used when this resource is accessed by
|
||||
allowed origins.</p>
|
||||
<p>If <code>All</code> is set, whatever is requested by the client in <code>Access-Control-Request-Headers</code>
|
||||
will be echoed back in the <code>Access-Control-Allow-Headers</code> header as specified in
|
||||
@@ -69,7 +69,7 @@ the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard C
|
||||
<p>Defaults to <code>All</code>.</p>
|
||||
</div><h4 id="method.expose_any_header" class="method"><code>pub fn <a href="#method.expose_any_header" class="fnname">expose_any_header</a>(self) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a></code><a class="srclink" href="../src/actix_cors/builder.rs.html#319-325" title="goto source code">[src]</a></h4><div class="docblock"><p>Resets exposed response header list to a state where any header is accepted.</p>
|
||||
<p>See <a href="../actix_cors/struct.Cors.html#method.expose_headers" title="Cors::expose_headers"><code>Cors::expose_headers</code></a> for more info on exposed response headers.</p>
|
||||
</div><h4 id="method.expose_headers" class="method"><code>pub fn <a href="#method.expose_headers" class="fnname">expose_headers</a><U, H>(self, headers: U) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = H>,<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>,<br> <H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/http/0.2.3/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>>, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#334-361" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a list of headers which are safe to expose to the API of a CORS API specification.
|
||||
</div><h4 id="method.expose_headers" class="method"><code>pub fn <a href="#method.expose_headers" class="fnname">expose_headers</a><U, H>(self, headers: U) -> <a class="struct" href="../actix_cors/struct.Cors.html" title="struct actix_cors::Cors">Cors</a> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = H>,<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>,<br> <H as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/header/name/struct.HeaderName.html" title="struct http::header::name::HeaderName">HeaderName</a>>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" title="type core::convert::TryInto::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/http/0.2.4/http/error/struct.Error.html" title="struct http::error::Error">HttpError</a>>, </span></code><a class="srclink" href="../src/actix_cors/builder.rs.html#334-361" title="goto source code">[src]</a></h4><div class="docblock"><p>Set a list of headers which are safe to expose to the API of a CORS API specification.
|
||||
This corresponds to the <code>Access-Control-Expose-Headers</code> response header as specified in
|
||||
the <a href="https://fetch.spec.whatwg.org/#http-cors-protocol">Fetch Standard CORS protocol</a>.</p>
|
||||
<p>This defaults to an empty set.</p>
|
||||
|
Reference in New Issue
Block a user