Compare commits
No commits in common. "gh-pages" and "master" have entirely different histories.
|
@ -0,0 +1,8 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "00:00"
|
||||||
|
open-pull-requests-limit: 10
|
|
@ -0,0 +1,68 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request: {}
|
||||||
|
|
||||||
|
name: Continuous integration
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
rust:
|
||||||
|
- stable
|
||||||
|
- nightly
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- windows-latest
|
||||||
|
- macOS-latest
|
||||||
|
|
||||||
|
cargo_flags:
|
||||||
|
- "--all-features"
|
||||||
|
- "--no-default-features"
|
||||||
|
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
name: Checkout
|
||||||
|
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
name: Verify Rust Toolchain
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: ${{ matrix.rust }}
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
name: Clippy Lint
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: ${{ matrix.cargo_flags }} --all-targets -- -D warnings
|
||||||
|
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
name: Build
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: ${{ matrix.cargo_flags }} --verbose
|
||||||
|
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
name: Unit Tests
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: ${{ matrix.cargo_flags }}
|
||||||
|
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
name: Format Check
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: --all -- --check
|
||||||
|
|
||||||
|
- uses: actions-rs/cargo@v1
|
||||||
|
name: Build Documentation
|
||||||
|
with:
|
||||||
|
command: doc
|
||||||
|
args: ${{ matrix.cargo_flags }} --no-deps
|
|
@ -0,0 +1,4 @@
|
||||||
|
target/
|
||||||
|
**/*.rs.bk
|
||||||
|
Cargo.lock
|
||||||
|
**/*.rs.fmt
|
|
@ -0,0 +1,73 @@
|
||||||
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 0.5.2 (2020-03-18)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- Add a builder methods for `CorsOptions` (#75)
|
||||||
|
|
||||||
|
## 0.5.1 (2019-11-13)
|
||||||
|
|
||||||
|
There are no new features.
|
||||||
|
|
||||||
|
- Fix build issues with Rocket 0.4.2
|
||||||
|
- Fix clippy lints with latest nightly
|
||||||
|
|
||||||
|
## <a name="0.5.0"></a>0.5.0 (2019-05-27)
|
||||||
|
|
||||||
|
There is no change since `0.5.0-beta1`.
|
||||||
|
|
||||||
|
### Breaking Changes
|
||||||
|
|
||||||
|
- The [`Cors`](https://lawliet89.github.io/rocket_cors/rocket_cors/struct.Cors.html) struct can no
|
||||||
|
longer be constructed. Instead, you will now construct the options for Cors directly or through
|
||||||
|
deserialization using the
|
||||||
|
[`CorsOptions`](https://lawliet89.github.io/rocket_cors/rocket_cors/struct.CorsOptions.html)
|
||||||
|
struct. Then, you can construct `Cors` for use in Fairings or manual responses using the
|
||||||
|
[`CorsOptions::to_cors`](https://lawliet89.github.io/rocket_cors/rocket_cors/struct.CorsOptions.html#method.to_cors)
|
||||||
|
method.
|
||||||
|
- The
|
||||||
|
[`AllowedOrigins`](https://lawliet89.github.io/rocket_cors/rocket_cors/type.AllowedOrigins.html)
|
||||||
|
type has been modified. It is now a typedef of `AllOrSome<Origins>` where
|
||||||
|
[`Origins`](https://lawliet89.github.io/rocket_cors/rocket_cors/struct.Origins.html) is now
|
||||||
|
a struct supporting exact matches or regex matches.
|
||||||
|
|
||||||
|
### Migrating existing Code
|
||||||
|
|
||||||
|
- Existing use of
|
||||||
|
[`AllowedOrigins::some`](https://docs.rs/rocket_cors/0.4.0/rocket_cors/type.AllowedOrigins.html#method.some)
|
||||||
|
to create exact matches can be replaced simply with
|
||||||
|
[`AllowedOrigins::some_exact`](https://lawliet89.github.io/rocket_cors/rocket_cors/type.AllowedOrigins.html#method.some_exact)
|
||||||
|
instead.
|
||||||
|
- Replace all construction of `Cors` struct with `CorsOptions` instead. Then, you can create the
|
||||||
|
`Cors` struct for use in Fairings using the
|
||||||
|
[`CorsOptions::to_cors`](https://lawliet89.github.io/rocket_cors/rocket_cors/struct.CorsOptions.html#method.to_cors)
|
||||||
|
method
|
||||||
|
|
||||||
|
```diff
|
||||||
|
-fn main() {
|
||||||
|
+fn main() -> Result<(), Error> {
|
||||||
|
let (allowed_origins, failed_origins) = AllowedOrigins::some(&["https://www.acme.com"]);
|
||||||
|
assert!(failed_origins.is_empty());
|
||||||
|
|
||||||
|
// You can also deserialize this
|
||||||
|
- let options = rocket_cors::Cors {
|
||||||
|
+ let cors = rocket_cors::CorsOptions {
|
||||||
|
allowed_origins: allowed_origins,
|
||||||
|
allowed_methods: vec![Method::Get].into_iter().map(From::from).collect(),
|
||||||
|
allowed_headers: AllowedHeaders::some(&["Authorization", "Accept"]),
|
||||||
|
allow_credentials: true,
|
||||||
|
..Default::default()
|
||||||
|
- };
|
||||||
|
+ }
|
||||||
|
+ .to_cors()?;
|
||||||
|
|
||||||
|
rocket::ignite()
|
||||||
|
.mount("/", routes![cors])
|
||||||
|
- .attach(options)
|
||||||
|
+ .attach(cors)
|
||||||
|
.launch();
|
||||||
|
+
|
||||||
|
+ Ok(())
|
||||||
|
}
|
||||||
|
```
|
|
@ -1,45 +0,0 @@
|
||||||
These documentation pages include resources by third parties. This copyright
|
|
||||||
file applies only to those resources. The following third party resources are
|
|
||||||
included, and carry their own copyright notices and license terms:
|
|
||||||
|
|
||||||
* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
|
|
||||||
|
|
||||||
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
|
|
||||||
with Reserved Font Name Fira Sans.
|
|
||||||
|
|
||||||
Copyright (c) 2014, Telefonica S.A.
|
|
||||||
|
|
||||||
Licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
See FiraSans-LICENSE.txt.
|
|
||||||
|
|
||||||
* rustdoc.css, main.js, and playpen.js:
|
|
||||||
|
|
||||||
Copyright 2015 The Rust Developers.
|
|
||||||
Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or
|
|
||||||
the MIT license (LICENSE-MIT.txt) at your option.
|
|
||||||
|
|
||||||
* normalize.css:
|
|
||||||
|
|
||||||
Copyright (c) Nicolas Gallagher and Jonathan Neal.
|
|
||||||
Licensed under the MIT license (see LICENSE-MIT.txt).
|
|
||||||
|
|
||||||
* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
|
|
||||||
|
|
||||||
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
|
|
||||||
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
|
|
||||||
of Adobe Systems Incorporated in the United States and/or other countries.
|
|
||||||
|
|
||||||
Licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
See SourceCodePro-LICENSE.txt.
|
|
||||||
|
|
||||||
* Source Serif Pro (SourceSerifPro-Regular.ttf.woff,
|
|
||||||
SourceSerifPro-Bold.ttf.woff, SourceSerifPro-It.ttf.woff):
|
|
||||||
|
|
||||||
Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with
|
|
||||||
Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of
|
|
||||||
Adobe Systems Incorporated in the United States and/or other countries.
|
|
||||||
|
|
||||||
Licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
See SourceSerifPro-LICENSE.txt.
|
|
||||||
|
|
||||||
This copyright file is intended to be distributed with rustdoc output.
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
[package]
|
||||||
|
name = "rocket_cors"
|
||||||
|
version = "0.5.2"
|
||||||
|
license = "MIT/Apache-2.0"
|
||||||
|
authors = ["Yong Wen Chua <me@yongwen.xyz>"]
|
||||||
|
description = "Cross-origin resource sharing (CORS) for Rocket.rs applications"
|
||||||
|
homepage = "https://github.com/lawliet89/rocket_cors"
|
||||||
|
repository = "https://github.com/lawliet89/rocket_cors"
|
||||||
|
documentation = "https://docs.rs/rocket_cors/"
|
||||||
|
keywords = ["rocket", "cors"]
|
||||||
|
categories = ["web-programming"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[badges]
|
||||||
|
travis-ci = { repository = "lawliet89/rocket_cors" }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["serialization"]
|
||||||
|
|
||||||
|
# Serialization and deserialization support for settings
|
||||||
|
serialization = ["serde", "serde_derive", "unicase_serde"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
regex = "1.1"
|
||||||
|
rocket = { rev="3a3d0ce51850368880fa3565f9fc96f7b4dcf06b", git = "https://github.com/SergioBenitez/Rocket.git", default-features = false }
|
||||||
|
log = "0.4"
|
||||||
|
unicase = "2.0"
|
||||||
|
url = "2.1.0"
|
||||||
|
|
||||||
|
# Optional dependencies that are activated by the various features
|
||||||
|
serde = { version = "1.0", optional = true }
|
||||||
|
serde_derive = { version = "1.0", optional = true }
|
||||||
|
unicase_serde = { version = "0.1.0", optional = true }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
serde_json = "1.0"
|
||||||
|
serde_test = "1.0"
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "fairing"
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "guard"
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "json"
|
||||||
|
required-features = ["serialization"]
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "manual"
|
||||||
|
|
||||||
|
[[example]]
|
||||||
|
name = "mix"
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
|
@ -1,94 +0,0 @@
|
||||||
Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A.
|
|
||||||
with Reserved Font Name < Fira >,
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
This license is copied below, and is also available with a FAQ at:
|
|
||||||
http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,201 @@
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright {yyyy} {name of copyright owner}
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
|
@ -1,201 +0,0 @@
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2017-2019 Yong Wen Chua
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,23 +0,0 @@
|
||||||
Permission is hereby granted, free of charge, to any
|
|
||||||
person obtaining a copy of this software and associated
|
|
||||||
documentation files (the "Software"), to deal in the
|
|
||||||
Software without restriction, including without
|
|
||||||
limitation the rights to use, copy, modify, merge,
|
|
||||||
publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software
|
|
||||||
is furnished to do so, subject to the following
|
|
||||||
conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice
|
|
||||||
shall be included in all copies or substantial portions
|
|
||||||
of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
||||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
||||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
|
||||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
||||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
DEALINGS IN THE SOFTWARE.
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
# rocket_cors
|
||||||
|
|
||||||
|
[![Build Status](https://travis-ci.org/lawliet89/rocket_cors.svg)](https://travis-ci.org/lawliet89/rocket_cors)
|
||||||
|
[![Repository](https://img.shields.io/github/tag/lawliet89/rocket_cors.svg)](https://github.com/lawliet89/rocket_cors)
|
||||||
|
[![Crates.io](https://img.shields.io/crates/v/rocket_cors.svg)](https://crates.io/crates/rocket_cors)
|
||||||
|
|
||||||
|
- Documentation: [master branch](https://lawliet89.github.io/rocket_cors) | [stable](https://docs.rs/rocket_cors)
|
||||||
|
|
||||||
|
Cross-origin resource sharing (CORS) for [Rocket](https://rocket.rs/) applications
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- Nightly Rust
|
||||||
|
- Rocket >= 0.4
|
||||||
|
|
||||||
|
If you are using Rocket 0.3, use the `0.3.0` version of this crate.
|
||||||
|
|
||||||
|
There is a minimum version of Rust nightly required. This is usually higher than whatever
|
||||||
|
Rocket requires plus more if the dependent crates require other features.
|
||||||
|
|
||||||
|
### Nightly Rust
|
||||||
|
|
||||||
|
Rocket requires nightly Rust. You should probably install Rust with
|
||||||
|
[rustup](https://www.rustup.rs/), then override the code directory to use nightly instead of stable.
|
||||||
|
See
|
||||||
|
[installation instructions](https://rocket.rs/guide/getting-started/#installing-rust).
|
||||||
|
|
||||||
|
In particular, `rocket_cors` is currently targetted for the latest `nightly`. Older nightlies might
|
||||||
|
work, but they are subject to the minimum that Rocket sets.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Add the following to Cargo.toml:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
rocket_cors = "0.5.1"
|
||||||
|
```
|
||||||
|
|
||||||
|
To use the latest `master` branch, for example:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" }
|
||||||
|
```
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
|
||||||
|
- [W3C CORS Recommendation](https://www.w3.org/TR/cors/#resource-processing-model)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
`rocket_cors` is licensed under either of the following, at your option:
|
||||||
|
|
||||||
|
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
||||||
|
- MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
|
@ -1,93 +0,0 @@
|
||||||
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
|
|
||||||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,93 +0,0 @@
|
||||||
Copyright 2014-2018 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
|
|
||||||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
var ALIASES = {};
|
|
||||||
ALIASES["rocket_cors"] = {};
|
|
|
@ -1 +0,0 @@
|
||||||
<?xml version="1.0" ?><svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg"><path d="M1615 0q70 0 122.5 46.5t52.5 116.5q0 63-45 151-332 629-465 752-97 91-218 91-126 0-216.5-92.5t-90.5-219.5q0-128 92-212l638-579q59-54 130-54zm-909 1034q39 76 106.5 130t150.5 76l1 71q4 213-129.5 347t-348.5 134q-123 0-218-46.5t-152.5-127.5-86.5-183-29-220q7 5 41 30t62 44.5 59 36.5 46 17q41 0 55-37 25-66 57.5-112.5t69.5-76 88-47.5 103-25.5 125-10.5z"/></svg>
|
|
Before Width: | Height: | Size: 477 B |
|
@ -1 +0,0 @@
|
||||||
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="128px" id="Layer_1" style="enable-background:new 0 0 128 128;" version="1.1" viewBox="-30 -20 176 176" width="128px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><line style="fill:none;stroke:#2F3435;stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="111" x2="64" y1="40.5" y2="87.499"/><line style="fill:none;stroke:#2F3435;stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="64" x2="17" y1="87.499" y2="40.5"/></g></svg>
|
|
Before Width: | Height: | Size: 641 B |
|
@ -0,0 +1,33 @@
|
||||||
|
use std::error::Error;
|
||||||
|
|
||||||
|
use rocket::http::Method;
|
||||||
|
use rocket::{get, routes};
|
||||||
|
use rocket_cors::{AllowedHeaders, AllowedOrigins};
|
||||||
|
|
||||||
|
#[get("/")]
|
||||||
|
fn cors<'a>() -> &'a str {
|
||||||
|
"Hello CORS"
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::main]
|
||||||
|
async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
let allowed_origins = AllowedOrigins::some_exact(&["https://www.acme.com"]);
|
||||||
|
|
||||||
|
// You can also deserialize this
|
||||||
|
let cors = rocket_cors::CorsOptions {
|
||||||
|
allowed_origins,
|
||||||
|
allowed_methods: vec![Method::Get].into_iter().map(From::from).collect(),
|
||||||
|
allowed_headers: AllowedHeaders::some(&["Authorization", "Accept"]),
|
||||||
|
allow_credentials: true,
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
.to_cors()?;
|
||||||
|
|
||||||
|
rocket::build()
|
||||||
|
.mount("/", routes![cors])
|
||||||
|
.attach(cors)
|
||||||
|
.launch()
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
use std::error::Error;
|
||||||
|
|
||||||
|
use rocket::http::Method;
|
||||||
|
use rocket::{get, options, routes};
|
||||||
|
use rocket_cors::{AllowedHeaders, AllowedOrigins, Guard, Responder};
|
||||||
|
|
||||||
|
/// Using a `Responder` -- the usual way you would use this
|
||||||
|
#[get("/")]
|
||||||
|
fn responder(cors: Guard<'_>) -> Responder<'_, '_, &str> {
|
||||||
|
cors.responder("Hello CORS!")
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Manually mount an OPTIONS route for your own handling
|
||||||
|
#[options("/manual")]
|
||||||
|
fn manual_options(cors: Guard<'_>) -> Responder<'_, '_, &str> {
|
||||||
|
cors.responder("Manual OPTIONS preflight handling")
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Manually mount an OPTIONS route for your own handling
|
||||||
|
#[get("/manual")]
|
||||||
|
fn manual(cors: Guard<'_>) -> Responder<'_, '_, &str> {
|
||||||
|
cors.responder("Manual OPTIONS preflight handling")
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::main]
|
||||||
|
async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
let allowed_origins = AllowedOrigins::some_exact(&["https://www.acme.com"]);
|
||||||
|
|
||||||
|
// You can also deserialize this
|
||||||
|
let cors = rocket_cors::CorsOptions {
|
||||||
|
allowed_origins,
|
||||||
|
allowed_methods: vec![Method::Get].into_iter().map(From::from).collect(),
|
||||||
|
allowed_headers: AllowedHeaders::some(&["Authorization", "Accept"]),
|
||||||
|
allow_credentials: true,
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
.to_cors()?;
|
||||||
|
|
||||||
|
rocket::build()
|
||||||
|
.mount("/", routes![responder])
|
||||||
|
// Mount the routes to catch all the OPTIONS pre-flight requests
|
||||||
|
.mount("/", rocket_cors::catch_all_options_routes())
|
||||||
|
// You can also manually mount an OPTIONS route that will be used instead
|
||||||
|
.mount("/", routes![manual, manual_options])
|
||||||
|
.manage(cors)
|
||||||
|
.launch()
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
//! This example is to demonstrate the JSON serialization and deserialization of the Cors settings
|
||||||
|
//!
|
||||||
|
//! Note: This requires the `serialization` feature which is enabled by default.
|
||||||
|
use rocket_cors as cors;
|
||||||
|
|
||||||
|
use crate::cors::{AllowedHeaders, AllowedOrigins, CorsOptions};
|
||||||
|
use rocket::http::Method;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// The default demonstrates the "All" serialization of several of the settings
|
||||||
|
let default: CorsOptions = Default::default();
|
||||||
|
|
||||||
|
let allowed_origins =
|
||||||
|
AllowedOrigins::some(&["https://www.acme.com"], &["^https://(.+).acme.com$"]);
|
||||||
|
|
||||||
|
let options = cors::CorsOptions {
|
||||||
|
allowed_origins,
|
||||||
|
allowed_methods: vec![Method::Get, Method::Post, Method::Delete]
|
||||||
|
.into_iter()
|
||||||
|
.map(From::from)
|
||||||
|
.collect(),
|
||||||
|
allowed_headers: AllowedHeaders::some(&["Authorization", "Accept"]),
|
||||||
|
allow_credentials: true,
|
||||||
|
expose_headers: ["Content-Type", "X-Custom"]
|
||||||
|
.iter()
|
||||||
|
.map(ToString::to_string)
|
||||||
|
.collect(),
|
||||||
|
max_age: Some(42),
|
||||||
|
send_wildcard: false,
|
||||||
|
fairing_route_base: "/mycors".to_string(),
|
||||||
|
fairing_route_rank: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
println!("Default settings");
|
||||||
|
println!("{}", serde_json::to_string_pretty(&default).unwrap());
|
||||||
|
|
||||||
|
println!("Defined settings");
|
||||||
|
println!("{}", serde_json::to_string_pretty(&options).unwrap());
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
use rocket::error::Error;
|
||||||
|
use rocket::http::Method;
|
||||||
|
use rocket::response::Responder;
|
||||||
|
use rocket::{get, options, routes, State};
|
||||||
|
use rocket_cors::{AllowedHeaders, AllowedOrigins, Cors, CorsOptions};
|
||||||
|
|
||||||
|
/// Using a borrowed Cors
|
||||||
|
///
|
||||||
|
/// You might want to borrow the `Cors` struct from Rocket's state, for example. Unless you have
|
||||||
|
/// special handling, you might want to use the Guard method instead which has less hassle.
|
||||||
|
///
|
||||||
|
/// Note that the `'r` lifetime annotation is not requred here because `State` borrows with lifetime
|
||||||
|
/// `'r` and so does `Responder`!
|
||||||
|
#[get("/")]
|
||||||
|
fn borrowed(options: &State<Cors>) -> impl Responder<'_, '_> {
|
||||||
|
options
|
||||||
|
.inner()
|
||||||
|
.respond_borrowed(|guard| guard.responder("Hello CORS"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create and use an ad-hoc Cors
|
||||||
|
/// Note that the `'r` lifetime is needed because the compiler cannot elide anything.
|
||||||
|
///
|
||||||
|
/// This is the most likely scenario when you want to have manual CORS validation. You can use this
|
||||||
|
/// when the settings you want to use for a route is not the same as the rest of the application
|
||||||
|
/// (which you might have put in Rocket's state).
|
||||||
|
#[get("/owned")]
|
||||||
|
fn owned<'r, 'o: 'r>() -> impl Responder<'r, 'o> {
|
||||||
|
let options = cors_options().to_cors()?;
|
||||||
|
options.respond_owned(|guard| guard.responder("Hello CORS"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// You need to define an OPTIONS route for preflight checks if you want to use `Cors` struct
|
||||||
|
/// that is not in Rocket's managed state.
|
||||||
|
/// These routes can just return the unit type `()`
|
||||||
|
/// Note that the `'r` lifetime is needed because the compiler cannot elide anything.
|
||||||
|
#[options("/owned")]
|
||||||
|
fn owned_options<'r, 'o: 'r>() -> impl Responder<'r, 'o> {
|
||||||
|
let options = cors_options().to_cors()?;
|
||||||
|
options.respond_owned(|guard| guard.responder(()))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn cors_options() -> CorsOptions {
|
||||||
|
let allowed_origins = AllowedOrigins::some_exact(&["https://www.acme.com"]);
|
||||||
|
|
||||||
|
// You can also deserialize this
|
||||||
|
rocket_cors::CorsOptions {
|
||||||
|
allowed_origins,
|
||||||
|
allowed_methods: vec![Method::Get].into_iter().map(From::from).collect(),
|
||||||
|
allowed_headers: AllowedHeaders::some(&["Authorization", "Accept"]),
|
||||||
|
allow_credentials: true,
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::main]
|
||||||
|
async fn main() -> Result<(), Error> {
|
||||||
|
rocket::build()
|
||||||
|
.mount("/", routes![borrowed, owned, owned_options,])
|
||||||
|
.mount("/", rocket_cors::catch_all_options_routes()) // mount the catch all routes
|
||||||
|
.manage(cors_options().to_cors().expect("To not fail"))
|
||||||
|
.launch()
|
||||||
|
.await
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
//! This is an example of how you can mix and match the "Truly manual" mode with "Guard".
|
||||||
|
//!
|
||||||
|
//! In this example, you typically have an application wide `Cors` struct except for one specific
|
||||||
|
//! `ping` route that you want to allow all Origins to access.
|
||||||
|
|
||||||
|
use rocket::error::Error;
|
||||||
|
use rocket::http::Method;
|
||||||
|
use rocket::response::Responder;
|
||||||
|
use rocket::{get, options, routes};
|
||||||
|
use rocket_cors::{AllowedHeaders, AllowedOrigins, CorsOptions, Guard};
|
||||||
|
|
||||||
|
/// The "usual" app route
|
||||||
|
#[get("/")]
|
||||||
|
fn app(cors: Guard<'_>) -> rocket_cors::Responder<'_, '_, &str> {
|
||||||
|
cors.responder("Hello CORS!")
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The special "ping" route
|
||||||
|
#[get("/ping")]
|
||||||
|
fn ping<'r, 'o: 'r>() -> impl Responder<'r, 'o> {
|
||||||
|
let cors = cors_options_all().to_cors()?;
|
||||||
|
cors.respond_owned(|guard| guard.responder("Pong!"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// You need to define an OPTIONS route for preflight checks if you want to use `Cors` struct
|
||||||
|
/// that is not in Rocket's managed state.
|
||||||
|
/// These routes can just return the unit type `()`
|
||||||
|
#[options("/ping")]
|
||||||
|
fn ping_options<'r, 'o: 'r>() -> impl Responder<'r, 'o> {
|
||||||
|
let cors = cors_options_all().to_cors()?;
|
||||||
|
cors.respond_owned(|guard| guard.responder(()))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the "application wide" Cors struct
|
||||||
|
fn cors_options() -> CorsOptions {
|
||||||
|
let allowed_origins = AllowedOrigins::some_exact(&["https://www.acme.com"]);
|
||||||
|
|
||||||
|
// You can also deserialize this
|
||||||
|
rocket_cors::CorsOptions {
|
||||||
|
allowed_origins,
|
||||||
|
allowed_methods: vec![Method::Get].into_iter().map(From::from).collect(),
|
||||||
|
allowed_headers: AllowedHeaders::some(&["Authorization", "Accept"]),
|
||||||
|
allow_credentials: true,
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A special struct that allows all origins
|
||||||
|
///
|
||||||
|
/// Note: In your real application, you might want to use something like `lazy_static` to generate
|
||||||
|
/// a `&'static` reference to this instead of creating a new struct on every request.
|
||||||
|
fn cors_options_all() -> CorsOptions {
|
||||||
|
// You can also deserialize this
|
||||||
|
Default::default()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::main]
|
||||||
|
async fn main() -> Result<(), Error> {
|
||||||
|
rocket::build()
|
||||||
|
.mount("/", routes![app, ping, ping_options,])
|
||||||
|
.mount("/", rocket_cors::catch_all_options_routes()) // mount the catch all routes
|
||||||
|
.manage(cors_options().to_cors().expect("To not fail"))
|
||||||
|
.launch()
|
||||||
|
.await
|
||||||
|
}
|
BIN
favicon.ico
BIN
favicon.ico
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"impl<T: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:false,types:["rocket_cors::Origins"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"struct\" href=\"rocket_cors/struct.Cors.html\" title=\"struct rocket_cors::Cors\">Cors</a>",synthetic:false,types:["rocket_cors::Cors"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"impl<T: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:false,types:["rocket_cors::Origins"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html\" title=\"trait core::cmp::Eq\">Eq</a> for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>> for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>> for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"impl<T: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T>> for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>> for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:false,types:["rocket_cors::Origins"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a><<a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>> for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl<'a> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><&'a <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.str.html\">str</a>> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl<'a> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"struct\" href=\"https://doc.rust-lang.org/nightly/alloc/string/struct.String.html\" title=\"struct alloc::string::String\">String</a>> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><<a class=\"enum\" href=\"https://docs.rs/url/2.0.0/url/parser/enum.ParseError.html\" title=\"enum url::parser::ParseError\">ParseError</a>> for <a class=\"enum\" href=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:false,types:["rocket_cors::Error"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Error> for <a class=\"enum\" href=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:false,types:["rocket_cors::Error"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a><Method> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl<T> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:false,types:["rocket_cors::Origins"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"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=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"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=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"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=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestMethod.html\" title=\"struct rocket_cors::headers::AccessControlRequestMethod\">AccessControlRequestMethod</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestMethod"]},{text:"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=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"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=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:false,types:["rocket_cors::Error"]},{text:"impl<T: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a>> <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=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"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=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},{text:"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=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:false,types:["rocket_cors::Origins"]},{text:"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=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},{text:"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=\"struct\" href=\"rocket_cors/struct.Cors.html\" title=\"struct rocket_cors::Cors\">Cors</a>",synthetic:false,types:["rocket_cors::Cors"]},{text:"impl<'r, R: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a>> <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=\"struct\" href=\"rocket_cors/struct.Responder.html\" title=\"struct rocket_cors::Responder\">Responder</a><'r, R>",synthetic:false,types:["rocket_cors::Responder"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"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=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"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=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"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=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:false,types:["rocket_cors::Error"]},{text:"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=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html\" title=\"trait core::hash::Hash\">Hash</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl Freeze for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:true,types:["rocket_cors::Method"]},{text:"impl Freeze for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:true,types:["rocket_cors::Origins"]},{text:"impl Freeze for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:true,types:["rocket_cors::CorsOptions"]},{text:"impl !Freeze for <a class=\"struct\" href=\"rocket_cors/struct.Cors.html\" title=\"struct rocket_cors::Cors\">Cors</a>",synthetic:true,types:["rocket_cors::Cors"]},{text:"impl<'r> Freeze for <a class=\"struct\" href=\"rocket_cors/struct.Guard.html\" title=\"struct rocket_cors::Guard\">Guard</a><'r>",synthetic:true,types:["rocket_cors::Guard"]},{text:"impl<'r, R> Freeze for <a class=\"struct\" href=\"rocket_cors/struct.Responder.html\" title=\"struct rocket_cors::Responder\">Responder</a><'r, R> <span class=\"where fmt-newline\">where<br> R: Freeze, </span>",synthetic:true,types:["rocket_cors::Responder"]},{text:"impl<'r, F, R> !Freeze for <a class=\"struct\" href=\"rocket_cors/struct.ManualResponder.html\" title=\"struct rocket_cors::ManualResponder\">ManualResponder</a><'r, F, R>",synthetic:true,types:["rocket_cors::ManualResponder"]},{text:"impl Freeze for <a class=\"enum\" href=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:true,types:["rocket_cors::Error"]},{text:"impl<T> Freeze for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T> <span class=\"where fmt-newline\">where<br> T: Freeze, </span>",synthetic:true,types:["rocket_cors::AllOrSome"]},{text:"impl Freeze for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:true,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl Freeze for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestMethod.html\" title=\"struct rocket_cors::headers::AccessControlRequestMethod\">AccessControlRequestMethod</a>",synthetic:true,types:["rocket_cors::headers::AccessControlRequestMethod"]},{text:"impl Freeze for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:true,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"impl Freeze for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:true,types:["rocket_cors::headers::Origin"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
File diff suppressed because one or more lines are too long
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"impl<T> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:false,types:["rocket_cors::Origins"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html\" title=\"trait core::marker::StructuralEq\">StructuralEq</a> for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"impl<T> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:false,types:["rocket_cors::Origins"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html\" title=\"trait core::marker::StructuralPartialEq\">StructuralPartialEq</a> for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html\" title=\"trait core::ops::deref::Deref\">Deref</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html\" title=\"trait core::ops::deref::Deref\">Deref</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html\" title=\"trait core::str::FromStr\">FromStr</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html\" title=\"trait core::str::FromStr\">FromStr</a> for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html\" title=\"trait core::str::FromStr\">FromStr</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestMethod.html\" title=\"struct rocket_cors::headers::AccessControlRequestMethod\">AccessControlRequestMethod</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestMethod"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html\" title=\"trait core::str::FromStr\">FromStr</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html\" title=\"trait core::str::FromStr\">FromStr</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html\" title=\"trait rocket::fairing::Fairing\">Fairing</a> for <a class=\"struct\" href=\"rocket_cors/struct.Cors.html\" title=\"struct rocket_cors::Cors\">Cors</a>",synthetic:false,types:["rocket_cors::Cors"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl<'a, 'r> <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html\" title=\"trait rocket::request::from_request::FromRequest\">FromRequest</a><'a, 'r> for <a class=\"enum\" href=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:false,types:["rocket_cors::headers::Origin"]},{text:"impl<'a, 'r> <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html\" title=\"trait rocket::request::from_request::FromRequest\">FromRequest</a><'a, 'r> for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestMethod.html\" title=\"struct rocket_cors::headers::AccessControlRequestMethod\">AccessControlRequestMethod</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestMethod"]},{text:"impl<'a, 'r> <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html\" title=\"trait rocket::request::from_request::FromRequest\">FromRequest</a><'a, 'r> for <a class=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:false,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"impl<'a, 'r> <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html\" title=\"trait rocket::request::from_request::FromRequest\">FromRequest</a><'a, 'r> for <a class=\"struct\" href=\"rocket_cors/struct.Guard.html\" title=\"struct rocket_cors::Guard\">Guard</a><'r>",synthetic:false,types:["rocket_cors::Guard"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl<'r> <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html\" title=\"trait rocket::response::responder::Responder\">Responder</a><'r> for <a class=\"enum\" href=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:false,types:["rocket_cors::Error"]},{text:"impl<'r, R: <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html\" title=\"trait rocket::response::responder::Responder\">Responder</a><'r>> <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html\" title=\"trait rocket::response::responder::Responder\">Responder</a><'r> for <a class=\"struct\" href=\"rocket_cors/struct.Responder.html\" title=\"struct rocket_cors::Responder\">Responder</a><'r, R>",synthetic:false,types:["rocket_cors::Responder"]},{text:"impl<'r, F, R> <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html\" title=\"trait rocket::response::responder::Responder\">Responder</a><'r> for <a class=\"struct\" href=\"rocket_cors/struct.ManualResponder.html\" title=\"struct rocket_cors::ManualResponder\">ManualResponder</a><'r, F, R> <span class=\"where fmt-newline\">where<br> F: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html\" title=\"trait core::ops::function::FnOnce\">FnOnce</a>(<a class=\"struct\" href=\"rocket_cors/struct.Guard.html\" title=\"struct rocket_cors::Guard\">Guard</a><'r>) -> R + 'r,<br> R: <a class=\"trait\" href=\"https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html\" title=\"trait rocket::response::responder::Responder\">Responder</a><'r>, </span>",synthetic:false,types:["rocket_cors::ManualResponder"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl<'de, T> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T> <span class=\"where fmt-newline\">where<br> T: <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de>, </span>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},{text:"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a> <span class=\"where fmt-newline\">where<br> <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a>, </span>",synthetic:false,types:["rocket_cors::Origins"]},{text:"impl<'de> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html\" title=\"trait serde::de::Deserialize\">Deserialize</a><'de> for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:false,types:["rocket_cors::headers::HeaderFieldName"]},{text:"impl<T> <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"enum\" href=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T> <span class=\"where fmt-newline\">where<br> T: <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a>, </span>",synthetic:false,types:["rocket_cors::AllOrSome"]},{text:"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:false,types:["rocket_cors::Method"]},{text:"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:false,types:["rocket_cors::Origins"]},{text:"impl <a class=\"trait\" href=\"https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html\" title=\"trait serde::ser::Serialize\">Serialize</a> for <a class=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:false,types:["rocket_cors::CorsOptions"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"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=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:false,types:["rocket_cors::Error"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"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=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:true,types:["rocket_cors::Method"]},{text:"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=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:true,types:["rocket_cors::Origins"]},{text:"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=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:true,types:["rocket_cors::CorsOptions"]},{text:"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=\"struct\" href=\"rocket_cors/struct.Cors.html\" title=\"struct rocket_cors::Cors\">Cors</a>",synthetic:true,types:["rocket_cors::Cors"]},{text:"impl<'r> <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=\"struct\" href=\"rocket_cors/struct.Guard.html\" title=\"struct rocket_cors::Guard\">Guard</a><'r>",synthetic:true,types:["rocket_cors::Guard"]},{text:"impl<'r, R> !<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=\"struct\" href=\"rocket_cors/struct.Responder.html\" title=\"struct rocket_cors::Responder\">Responder</a><'r, R>",synthetic:true,types:["rocket_cors::Responder"]},{text:"impl<'r, F, R> !<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=\"struct\" href=\"rocket_cors/struct.ManualResponder.html\" title=\"struct rocket_cors::ManualResponder\">ManualResponder</a><'r, F, R>",synthetic:true,types:["rocket_cors::ManualResponder"]},{text:"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=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:true,types:["rocket_cors::Error"]},{text:"impl<T> <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=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T> <span class=\"where fmt-newline\">where<br> T: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html\" title=\"trait std::panic::RefUnwindSafe\">RefUnwindSafe</a>, </span>",synthetic:true,types:["rocket_cors::AllOrSome"]},{text:"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=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:true,types:["rocket_cors::headers::HeaderFieldName"]},{text:"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=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestMethod.html\" title=\"struct rocket_cors::headers::AccessControlRequestMethod\">AccessControlRequestMethod</a>",synthetic:true,types:["rocket_cors::headers::AccessControlRequestMethod"]},{text:"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=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:true,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"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=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:true,types:["rocket_cors::headers::Origin"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function() {var implementors = {};
|
|
||||||
implementors["rocket_cors"] = [{text:"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=\"struct\" href=\"rocket_cors/struct.Method.html\" title=\"struct rocket_cors::Method\">Method</a>",synthetic:true,types:["rocket_cors::Method"]},{text:"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=\"struct\" href=\"rocket_cors/struct.Origins.html\" title=\"struct rocket_cors::Origins\">Origins</a>",synthetic:true,types:["rocket_cors::Origins"]},{text:"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=\"struct\" href=\"rocket_cors/struct.CorsOptions.html\" title=\"struct rocket_cors::CorsOptions\">CorsOptions</a>",synthetic:true,types:["rocket_cors::CorsOptions"]},{text:"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=\"struct\" href=\"rocket_cors/struct.Cors.html\" title=\"struct rocket_cors::Cors\">Cors</a>",synthetic:true,types:["rocket_cors::Cors"]},{text:"impl<'r> <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=\"struct\" href=\"rocket_cors/struct.Guard.html\" title=\"struct rocket_cors::Guard\">Guard</a><'r>",synthetic:true,types:["rocket_cors::Guard"]},{text:"impl<'r, R> !<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=\"struct\" href=\"rocket_cors/struct.Responder.html\" title=\"struct rocket_cors::Responder\">Responder</a><'r, R>",synthetic:true,types:["rocket_cors::Responder"]},{text:"impl<'r, F, R> !<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=\"struct\" href=\"rocket_cors/struct.ManualResponder.html\" title=\"struct rocket_cors::ManualResponder\">ManualResponder</a><'r, F, R>",synthetic:true,types:["rocket_cors::ManualResponder"]},{text:"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=\"rocket_cors/enum.Error.html\" title=\"enum rocket_cors::Error\">Error</a>",synthetic:true,types:["rocket_cors::Error"]},{text:"impl<T> <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=\"rocket_cors/enum.AllOrSome.html\" title=\"enum rocket_cors::AllOrSome\">AllOrSome</a><T> <span class=\"where fmt-newline\">where<br> T: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html\" title=\"trait std::panic::UnwindSafe\">UnwindSafe</a>, </span>",synthetic:true,types:["rocket_cors::AllOrSome"]},{text:"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=\"struct\" href=\"rocket_cors/headers/struct.HeaderFieldName.html\" title=\"struct rocket_cors::headers::HeaderFieldName\">HeaderFieldName</a>",synthetic:true,types:["rocket_cors::headers::HeaderFieldName"]},{text:"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=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestMethod.html\" title=\"struct rocket_cors::headers::AccessControlRequestMethod\">AccessControlRequestMethod</a>",synthetic:true,types:["rocket_cors::headers::AccessControlRequestMethod"]},{text:"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=\"struct\" href=\"rocket_cors/headers/struct.AccessControlRequestHeaders.html\" title=\"struct rocket_cors::headers::AccessControlRequestHeaders\">AccessControlRequestHeaders</a>",synthetic:true,types:["rocket_cors::headers::AccessControlRequestHeaders"]},{text:"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=\"rocket_cors/headers/enum.Origin.html\" title=\"enum rocket_cors::headers::Origin\">Origin</a>",synthetic:true,types:["rocket_cors::headers::Origin"]},];
|
|
||||||
|
|
||||||
if (window.register_implementors) {
|
|
||||||
window.register_implementors(implementors);
|
|
||||||
} else {
|
|
||||||
window.pending_implementors = implementors;
|
|
||||||
}
|
|
||||||
})()
|
|
|
@ -1 +0,0 @@
|
||||||
<meta http-equiv=refresh content=0;url=rocket_cors/index.html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */
|
|
||||||
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
|
|
|
@ -1 +0,0 @@
|
||||||
#main>h2+div,#main>h2+h3,#main>h3+div{display:block;}.loading-content{display:none;}#main>h2+div,#main>h3+div{display:block;}#main>h2+h3{display:flex;}
|
|
|
@ -1,3 +0,0 @@
|
||||||
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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>
|
|
||||||
</span>
|
|
||||||
<span class='in-band'>List of all items</span></h1><h3 id='Structs'>Structs</h3><ul class='structs docblock'><li><a href='struct.Cors.html'>Cors</a></li><li><a href='struct.CorsOptions.html'>CorsOptions</a></li><li><a href='struct.Guard.html'>Guard</a></li><li><a href='struct.ManualResponder.html'>ManualResponder</a></li><li><a href='struct.Method.html'>Method</a></li><li><a href='struct.Origins.html'>Origins</a></li><li><a href='struct.Responder.html'>Responder</a></li><li><a href='headers/struct.AccessControlRequestHeaders.html'>headers::AccessControlRequestHeaders</a></li><li><a href='headers/struct.AccessControlRequestMethod.html'>headers::AccessControlRequestMethod</a></li><li><a href='headers/struct.HeaderFieldName.html'>headers::HeaderFieldName</a></li></ul><h3 id='Enums'>Enums</h3><ul class='enums docblock'><li><a href='enum.AllOrSome.html'>AllOrSome</a></li><li><a href='enum.Error.html'>Error</a></li><li><a href='headers/enum.Origin.html'>headers::Origin</a></li></ul><h3 id='Functions'>Functions</h3><ul class='functions docblock'><li><a href='fn.catch_all_options_routes.html'>catch_all_options_routes</a></li></ul><h3 id='Typedefs'>Typedefs</h3><ul class='typedefs docblock'><li><a href='type.AllowedHeaders.html'>AllowedHeaders</a></li><li><a href='type.AllowedMethods.html'>AllowedMethods</a></li><li><a href='type.AllowedOrigins.html'>AllowedOrigins</a></li><li><a href='headers/type.HeaderFieldNamesSet.html'>headers::HeaderFieldNamesSet</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,41 +0,0 @@
|
||||||
<!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="API documentation for the Rust `AllOrSome` enum in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, AllOrSome"><title>rocket_cors::AllOrSome - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Enum AllOrSome</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.All">All</a><a href="#variant.Some">Some</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.is_all">is_all</a><a href="#method.is_some">is_some</a><a href="#method.unwrap">unwrap</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-PartialEq%3CAllOrSome%3CT%3E%3E">PartialEq<AllOrSome<T>></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</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-AsResult%3CT%2C%20I%3E">AsResult<T, I></a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-Typeable">Typeable</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'AllOrSome', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#448-453' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='index.html'>rocket_cors</a>::<wbr><a class="enum" href=''>AllOrSome</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum AllOrSome<T> {
|
|
||||||
All,
|
|
||||||
Some(T),
|
|
||||||
}</pre></div><div class='docblock'><p>An enum signifying that some of type T is allowed, or <code>All</code> (everything is allowed).</p>
|
|
||||||
<p><code>Default</code> is implemented for this enum and is <code>All</code>.</p>
|
|
||||||
<p>This enum is serialized and deserialized
|
|
||||||
<a href="https://serde.rs/enum-representations.html">"Externally tagged"</a></p>
|
|
||||||
</div><h2 id='variants' class='variants small-section-header'>
|
|
||||||
Variants<a href='#variants' class='anchor'></a></h2>
|
|
||||||
<div id="variant.All" class="variant small-section-header"><a href="#variant.All" class="anchor field"></a><code id='All.v'>All</code></div><div class='docblock'><p>Everything is allowed. Usually equivalent to the "*" value.</p>
|
|
||||||
</div><div id="variant.Some" class="variant small-section-header"><a href="#variant.Some" class="anchor field"></a><code id='Some.v'>Some(T)</code></div><div class='docblock'><p>Only some of <code>T</code> is allowed</p>
|
|
||||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<T> <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#461-485' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.is_all' class="method"><code id='is_all.v'>pub fn <a href='#method.is_all' class='fnname'>is_all</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#463-468' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns whether this is an <code>All</code> variant</p>
|
|
||||||
</div><h4 id='method.is_some' class="method"><code id='is_some.v'>pub fn <a href='#method.is_some' class='fnname'>is_some</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#471-473' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns whether this is a <code>Some</code> variant</p>
|
|
||||||
</div><h4 id='method.unwrap' class="method"><code id='unwrap.v'>pub fn <a href='#method.unwrap' class='fnname'>unwrap</a>(self) -> T</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#479-484' title='goto source code'>[src]</a></h4><div class='docblock'><p>Unwrap a <code>Some</code> variant and get its inner value</p>
|
|
||||||
<h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
|
|
||||||
<p>Panics if the variant is <code>All</code></p>
|
|
||||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>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#131-133' 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-Default' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#455-459' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#456-458' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3CAllOrSome%3CT%3E%3E' class='impl'><code class='in-band'>impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>> <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T>> for <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a href='#impl-PartialEq%3CAllOrSome%3CT%3E%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
|
||||||
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
|
|
||||||
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>> <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="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>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/rocket_cors/lib.rs.html#446' 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-StructuralPartialEq' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#446' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a>, </span></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#447' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#447' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de, T> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#447' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code id='deserialize.v'>fn <a href='https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#447' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html#tymethod.deserialize">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-Send' class='impl'><code class='in-band'>impl<T> <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="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></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<T> <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="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></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<T> <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="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></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<T> <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="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<T> <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="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
|
||||||
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
|
||||||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.102/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<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-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#19-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
|
|
||||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,61 +0,0 @@
|
||||||
<!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="API documentation for the Rust `Error` enum in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, Error"><title>rocket_cors::Error - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Error</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.MissingOrigin">MissingOrigin</a><a href="#variant.BadOrigin">BadOrigin</a><a href="#variant.OpaqueAllowedOrigin">OpaqueAllowedOrigin</a><a href="#variant.MissingRequestMethod">MissingRequestMethod</a><a href="#variant.BadRequestMethod">BadRequestMethod</a><a href="#variant.MissingRequestHeaders">MissingRequestHeaders</a><a href="#variant.OriginNotAllowed">OriginNotAllowed</a><a href="#variant.MethodNotAllowed">MethodNotAllowed</a><a href="#variant.RegexError">RegexError</a><a href="#variant.HeadersNotAllowed">HeadersNotAllowed</a><a href="#variant.CredentialsWithWildcardOrigin">CredentialsWithWildcardOrigin</a><a href="#variant.MissingCorsInRocketState">MissingCorsInRocketState</a><a href="#variant.MissingInjectedHeader">MissingInjectedHeader</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-From%3CParseError%3E">From<ParseError></a><a href="#impl-Responder%3C%27r%3E">Responder<'r></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-AsResult%3CT%2C%20I%3E">AsResult<T, I></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-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></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-Typeable">Typeable</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'Error', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#306-338' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='index.html'>rocket_cors</a>::<wbr><a class="enum" href=''>Error</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Error {
|
|
||||||
MissingOrigin,
|
|
||||||
BadOrigin(<a class="enum" href="https://docs.rs/url/2.0.0/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>),
|
|
||||||
OpaqueAllowedOrigin(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>),
|
|
||||||
MissingRequestMethod,
|
|
||||||
BadRequestMethod,
|
|
||||||
MissingRequestHeaders,
|
|
||||||
OriginNotAllowed(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
|
|
||||||
MethodNotAllowed(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
|
|
||||||
RegexError(Error),
|
|
||||||
HeadersNotAllowed,
|
|
||||||
CredentialsWithWildcardOrigin,
|
|
||||||
MissingCorsInRocketState,
|
|
||||||
MissingInjectedHeader,
|
|
||||||
}</pre></div><div class='docblock'><p>Errors during operations</p>
|
|
||||||
<p>This enum implements <code>rocket::response::Responder</code> which will return an appropriate status code
|
|
||||||
while printing out the error in the console.
|
|
||||||
Because these errors are usually the result of an error while trying to respond to a CORS
|
|
||||||
request, CORS headers cannot be added to the response and your applications requesting CORS
|
|
||||||
will not be able to see the status code.</p>
|
|
||||||
</div><h2 id='variants' class='variants small-section-header'>
|
|
||||||
Variants<a href='#variants' class='anchor'></a></h2>
|
|
||||||
<div id="variant.MissingOrigin" class="variant small-section-header"><a href="#variant.MissingOrigin" class="anchor field"></a><code id='MissingOrigin.v'>MissingOrigin</code></div><div class='docblock'><p>The HTTP request header <code>Origin</code> is required but was not provided</p>
|
|
||||||
</div><div id="variant.BadOrigin" class="variant small-section-header"><a href="#variant.BadOrigin" class="anchor field"></a><code id='BadOrigin.v'>BadOrigin(<a class="enum" href="https://docs.rs/url/2.0.0/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>)</code></div><div class='docblock'><p>The HTTP request header <code>Origin</code> could not be parsed correctly.</p>
|
|
||||||
</div><div id="variant.OpaqueAllowedOrigin" class="variant small-section-header"><a href="#variant.OpaqueAllowedOrigin" class="anchor field"></a><code id='OpaqueAllowedOrigin.v'>OpaqueAllowedOrigin(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>)</code></div><div class='docblock'><p>The configured Allowed Origins are Opaque origins. Use a Regex instead.</p>
|
|
||||||
</div><div id="variant.MissingRequestMethod" class="variant small-section-header"><a href="#variant.MissingRequestMethod" class="anchor field"></a><code id='MissingRequestMethod.v'>MissingRequestMethod</code></div><div class='docblock'><p>The request header <code>Access-Control-Request-Method</code> is required but is missing</p>
|
|
||||||
</div><div id="variant.BadRequestMethod" class="variant small-section-header"><a href="#variant.BadRequestMethod" class="anchor field"></a><code id='BadRequestMethod.v'>BadRequestMethod</code></div><div class='docblock'><p>The request header <code>Access-Control-Request-Method</code> has an invalid value</p>
|
|
||||||
</div><div id="variant.MissingRequestHeaders" class="variant small-section-header"><a href="#variant.MissingRequestHeaders" class="anchor field"></a><code id='MissingRequestHeaders.v'>MissingRequestHeaders</code></div><div class='docblock'><p>The request header <code>Access-Control-Request-Headers</code> is required but is missing.</p>
|
|
||||||
</div><div id="variant.OriginNotAllowed" class="variant small-section-header"><a href="#variant.OriginNotAllowed" class="anchor field"></a><code id='OriginNotAllowed.v'>OriginNotAllowed(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div class='docblock'><p>Origin is not allowed to make this request</p>
|
|
||||||
</div><div id="variant.MethodNotAllowed" class="variant small-section-header"><a href="#variant.MethodNotAllowed" class="anchor field"></a><code id='MethodNotAllowed.v'>MethodNotAllowed(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div class='docblock'><p>Requested method is not allowed</p>
|
|
||||||
</div><div id="variant.RegexError" class="variant small-section-header"><a href="#variant.RegexError" class="anchor field"></a><code id='RegexError.v'>RegexError(Error)</code></div><div class='docblock'><p>A regular expression compilation error</p>
|
|
||||||
</div><div id="variant.HeadersNotAllowed" class="variant small-section-header"><a href="#variant.HeadersNotAllowed" class="anchor field"></a><code id='HeadersNotAllowed.v'>HeadersNotAllowed</code></div><div class='docblock'><p>One or more headers requested are not allowed</p>
|
|
||||||
</div><div id="variant.CredentialsWithWildcardOrigin" class="variant small-section-header"><a href="#variant.CredentialsWithWildcardOrigin" class="anchor field"></a><code id='CredentialsWithWildcardOrigin.v'>CredentialsWithWildcardOrigin</code></div><div class='docblock'><p>Credentials are allowed, but the Origin is set to "*". This is not allowed by W3C</p>
|
|
||||||
<p>This is a misconfiguration. Check the docuemntation for <code>Cors</code>.</p>
|
|
||||||
</div><div id="variant.MissingCorsInRocketState" class="variant small-section-header"><a href="#variant.MissingCorsInRocketState" class="anchor field"></a><code id='MissingCorsInRocketState.v'>MissingCorsInRocketState</code></div><div class='docblock'><p>A CORS Request Guard was used, but no CORS Options was available in Rocket's state</p>
|
|
||||||
<p>This is a misconfiguration. Use <code>Rocket::manage</code> to add a CORS options to managed state.</p>
|
|
||||||
</div><div id="variant.MissingInjectedHeader" class="variant small-section-header"><a href="#variant.MissingInjectedHeader" class="anchor field"></a><code id='MissingInjectedHeader.v'>MissingInjectedHeader</code></div><div class='docblock'><p>The <code>on_response</code> handler of Fairing could not find the injected header from the Request.
|
|
||||||
Either some other fairing has removed it, or this is a bug.</p>
|
|
||||||
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-From%3CParseError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="https://docs.rs/url/2.0.0/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>> for <a class="enum" href="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code><a href='#impl-From%3CParseError%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#428-432' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(error: <a class="enum" href="https://docs.rs/url/2.0.0/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>) -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#429-431' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CError%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Error> for <a class="enum" href="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code><a href='#impl-From%3CError%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#434-438' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(error: Error) -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#435-437' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#355-410' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.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/rocket_cors/lib.rs.html#356-409' 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-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="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#305' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>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/rocket_cors/lib.rs.html#305' 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-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="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code><a href='#impl-Error' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#412-419' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cause' class="method hidden"><code id='cause.v'>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><a class='srclink' href='../src/rocket_cors/lib.rs.html#413-418' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab deprecated'>Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
|
|
||||||
</div></div><div class='docblock hidden'><p>The lower-level cause of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause">Read more</a></p>
|
|
||||||
</div><h4 id='method.description' class="method hidden"><code id='description.v'>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#70-72' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method is soft-deprecated. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></p>
|
|
||||||
</div><h4 id='method.source' class="method hidden"><code id='source.v'>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#198' 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 id='backtrace.v'>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#219-221' title='goto source code'>[src]</a></h4><div class='stability 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 ocurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Responder%3C%27r%3E' class='impl'><code class='in-band'>impl<'r> <a class="trait" href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html" title="trait rocket::response::responder::Responder">Responder</a><'r> for <a class="enum" href="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code><a href='#impl-Responder%3C%27r%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#421-426' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.respond_to' class="method hidden"><code id='respond_to.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html#tymethod.respond_to' class='fnname'>respond_to</a>(self, _: &<a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://api.rocket.rs/v0.4/rocket/response/response/struct.Response.html" title="struct rocket::response::response::Response">Response</a><'r>, Status></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#422-425' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns <code>Ok</code> if a <code>Response</code> could be generated successfully. Otherwise, returns an <code>Err</code> with a failing <code>Status</code>. <a href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html#tymethod.respond_to">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-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="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</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="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</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="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</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="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><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="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<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-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2171-2181' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2173-2180' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,7 +0,0 @@
|
||||||
<!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="API documentation for the Rust `catch_all_options_routes` fn in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, catch_all_options_routes"><title>rocket_cors::catch_all_options_routes - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'catch_all_options_routes', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#1928-1943' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='index.html'>rocket_cors</a>::<wbr><a class="fn" href=''>catch_all_options_routes</a></span></h1><pre class='rust fn'>pub fn catch_all_options_routes() -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://api.rocket.rs/v0.4/rocket/router/route/struct.Route.html" title="struct rocket::router::route::Route">Route</a>></pre><div class='docblock'><p>Returns "catch all" OPTIONS routes that you can mount to catch all OPTIONS request. Only works
|
|
||||||
if you have put a <code>Cors</code> struct into Rocket's managed state.</p>
|
|
||||||
<p>This route has very high rank (and therefore low priority) of
|
|
||||||
<a href="https://doc.rust-lang.org/nightly/std/primitive.isize.html#method.max_value">max value</a>
|
|
||||||
so you can define your own to override this route's behaviour.</p>
|
|
||||||
<p>See the documentation at the <a href="index.html">crate root</a> for usage information.</p>
|
|
||||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,47 +0,0 @@
|
||||||
<!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="API documentation for the Rust `Origin` enum in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, Origin"><title>rocket_cors::headers::Origin - 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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../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">☰</div><a href='../../rocket_cors/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Enum Origin</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Null">Null</a><a href="#variant.Parsed">Parsed</a><a href="#variant.Opaque">Opaque</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.ascii_serialization">ascii_serialization</a><a href="#method.is_tuple">is_tuple</a></div><a class="sidebar-title" href="#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-Eq">Eq</a><a href="#impl-FromRequest%3C%27a%2C%20%27r%3E">FromRequest<'a, 'r></a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3COrigin%3E">PartialEq<Origin></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</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-AsResult%3CT%2C%20I%3E">AsResult<T, I></a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<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-Typeable">Typeable</a></div></div><p class='location'><a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a></p><script>window.sidebarCurrent = {name: 'Origin', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/headers.rs.html#69-76' title='goto source code'>[src]</a></span><span class='in-band'>Enum <a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a>::<wbr><a class="enum" href=''>Origin</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust enum'>pub enum Origin {
|
|
||||||
Null,
|
|
||||||
Parsed(<a class="enum" href="https://docs.rs/url/2.0.0/url/origin/enum.Origin.html" title="enum url::origin::Origin">Origin</a>),
|
|
||||||
Opaque(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
|
|
||||||
}</pre></div><div class='docblock'><p>The <code>Origin</code> request header used in CORS</p>
|
|
||||||
<p>You can use this as a rocket <a href="https://rocket.rs/guide/requests/#request-guards">Request Guard</a>
|
|
||||||
to ensure that <code>Origin</code> is passed in correctly.</p>
|
|
||||||
<p>Reference: <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin">Mozilla</a></p>
|
|
||||||
</div><h2 id='variants' class='variants small-section-header'>
|
|
||||||
Variants<a href='#variants' class='anchor'></a></h2>
|
|
||||||
<div id="variant.Null" class="variant small-section-header"><a href="#variant.Null" class="anchor field"></a><code id='Null.v'>Null</code></div><div class='docblock'><p>A <code>null</code> Origin</p>
|
|
||||||
</div><div id="variant.Parsed" class="variant small-section-header"><a href="#variant.Parsed" class="anchor field"></a><code id='Parsed.v'>Parsed(<a class="enum" href="https://docs.rs/url/2.0.0/url/origin/enum.Origin.html" title="enum url::origin::Origin">Origin</a>)</code></div><div class='docblock'><p>A well-formed origin that was parsed by <a href="https://docs.rs/url/2.0.0/url/struct.Url.html#method.origin" title="`url::Url::origin`"><code>url::Url::origin</code></a></p>
|
|
||||||
</div><div id="variant.Opaque" class="variant small-section-header"><a href="#variant.Opaque" class="anchor field"></a><code id='Opaque.v'>Opaque(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></div><div class='docblock'><p>An unknown "opaque" origin that could not be parsed</p>
|
|
||||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#78-94' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.ascii_serialization' class="method"><code id='ascii_serialization.v'>pub fn <a href='#method.ascii_serialization' class='fnname'>ascii_serialization</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#82-84' title='goto source code'>[src]</a></h4><div class='docblock'><p>Perform an
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/#ascii-serialisation-of-an-origin">ASCII serialization</a>
|
|
||||||
of this origin.</p>
|
|
||||||
</div><h4 id='method.is_tuple' class="method"><code id='is_tuple.v'>pub fn <a href='#method.is_tuple' class='fnname'>is_tuple</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#87-93' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns whether the origin was parsed as non-opaque</p>
|
|
||||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>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#131-133' 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-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3COrigin%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a>> for <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-PartialEq%3COrigin%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
|
||||||
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</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="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#111-119' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.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/rocket_cors/headers.rs.html#112-118' 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-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="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>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/rocket_cors/headers.rs.html#68' 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-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-FromStr' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#96-109' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="enum" href="../../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
|
|
||||||
</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(input: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#99-108' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
|
|
||||||
</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#194-200' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#68' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-FromRequest%3C%27a%2C%20%27r%3E' class='impl'><code class='in-band'>impl<'a, 'r> <a class="trait" href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html" title="trait rocket::request::from_request::FromRequest">FromRequest</a><'a, 'r> for <a class="enum" href="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-FromRequest%3C%27a%2C%20%27r%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#121-133' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code></h4><div class='docblock'><p>The associated error to be returned if derivation fails.</p>
|
|
||||||
</div><h4 id='method.from_request' class="method hidden"><code id='from_request.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request' class='fnname'>from_request</a>(request: &'a <a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a><'r>) -> <a class="type" href="https://api.rocket.rs/v0.4/rocket/request/from_request/type.Outcome.html" title="type rocket::request::from_request::Outcome">Outcome</a><Self, <a class="enum" href="../../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a>></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#124-132' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Derives an instance of <code>Self</code> from the incoming request metadata. <a href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request">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-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="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</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="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</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="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</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="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><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="../../rocket_cors/headers/enum.Origin.html" title="enum rocket_cors::headers::Origin">Origin</a></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
|
||||||
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
|
||||||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<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-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2171-2181' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2173-2180' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-2' class="type"><code id='Error.t-2'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<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-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#19-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
|
|
||||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "rocket_cors";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
|
@ -1,10 +0,0 @@
|
||||||
<!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="API documentation for the Rust `headers` mod in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, headers"><title>rocket_cors::headers - 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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../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">☰</div><a href='../../rocket_cors/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module headers</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'headers', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/headers.rs.html#1-358' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>rocket_cors</a>::<wbr><a class="mod" href=''>headers</a></span></h1><div class='docblock'><p>CORS specific Request Headers</p>
|
|
||||||
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
|
||||||
<table><tr class='module-item'><td><a class="struct" href="struct.AccessControlRequestHeaders.html" title='rocket_cors::headers::AccessControlRequestHeaders struct'>AccessControlRequestHeaders</a></td><td class='docblock-short'><p>The <code>Access-Control-Request-Headers</code> request header</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.AccessControlRequestMethod.html" title='rocket_cors::headers::AccessControlRequestMethod struct'>AccessControlRequestMethod</a></td><td class='docblock-short'><p>The <code>Access-Control-Request-Method</code> request header</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.HeaderFieldName.html" title='rocket_cors::headers::HeaderFieldName struct'>HeaderFieldName</a></td><td class='docblock-short'><p>A case insensitive header name</p>
|
|
||||||
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
|
||||||
<table><tr class='module-item'><td><a class="enum" href="enum.Origin.html" title='rocket_cors::headers::Origin enum'>Origin</a></td><td class='docblock-short'><p>The <code>Origin</code> request header used in CORS</p>
|
|
||||||
</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
|
|
||||||
<table><tr class='module-item'><td><a class="type" href="type.HeaderFieldNamesSet.html" title='rocket_cors::headers::HeaderFieldNamesSet type'>HeaderFieldNamesSet</a></td><td class='docblock-short'><p>A set of case insensitive header names</p>
|
|
||||||
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "rocket_cors";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
|
@ -1 +0,0 @@
|
||||||
initSidebarItems({"enum":[["Origin","The `Origin` request header used in CORS"]],"struct":[["AccessControlRequestHeaders","The `Access-Control-Request-Headers` request header"],["AccessControlRequestMethod","The `Access-Control-Request-Method` request header"],["HeaderFieldName","A case insensitive header name"]],"type":[["HeaderFieldNamesSet","A set of case insensitive header names"]]});
|
|
|
@ -1,24 +0,0 @@
|
||||||
<!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="API documentation for the Rust `AccessControlRequestHeaders` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, AccessControlRequestHeaders"><title>rocket_cors::headers::AccessControlRequestHeaders - 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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../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">☰</div><a href='../../rocket_cors/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct AccessControlRequestHeaders</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-FromRequest%3C%27a%2C%20%27r%3E">FromRequest<'a, 'r></a><a href="#impl-FromStr">FromStr</a><a href="#impl-PartialEq%3CAccessControlRequestHeaders%3E">PartialEq<AccessControlRequestHeaders></a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</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-AsResult%3CT%2C%20I%3E">AsResult<T, I></a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-Typeable">Typeable</a></div></div><p class='location'><a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a></p><script>window.sidebarCurrent = {name: 'AccessControlRequestHeaders', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/headers.rs.html#168' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a>::<wbr><a class="struct" href=''>AccessControlRequestHeaders</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct AccessControlRequestHeaders(pub <a class="type" href="../../rocket_cors/headers/type.HeaderFieldNamesSet.html" title="type rocket_cors::headers::HeaderFieldNamesSet">HeaderFieldNamesSet</a>);</pre></div><div class='docblock'><p>The <code>Access-Control-Request-Headers</code> request header</p>
|
|
||||||
<p>You can use this as a rocket <a href="https://rocket.rs/guide/requests/#request-guards">Request Guard</a>
|
|
||||||
to ensure that the header is passed in correctly.</p>
|
|
||||||
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#167' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3CAccessControlRequestHeaders%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a>> for <a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-PartialEq%3CAccessControlRequestHeaders%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#167' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#167' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
|
||||||
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#167' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#167' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>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/rocket_cors/headers.rs.html#167' 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-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-FromStr' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#171-186' title='goto source code'>[src]</a></h3><div class='docblock'><p>Will never fail</p>
|
|
||||||
</div><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
|
|
||||||
</div><h4 id='method.from_str' class="method"><code id='from_str.v'>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(headers: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#175-185' title='goto source code'>[src]</a></h4><div class='docblock'><p>Will never fail</p>
|
|
||||||
</div></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#167' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#167' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-FromRequest%3C%27a%2C%20%27r%3E' class='impl'><code class='in-band'>impl<'a, 'r> <a class="trait" href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html" title="trait rocket::request::from_request::FromRequest">FromRequest</a><'a, 'r> for <a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-FromRequest%3C%27a%2C%20%27r%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#188-202' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code></h4><div class='docblock'><p>The associated error to be returned if derivation fails.</p>
|
|
||||||
</div><h4 id='method.from_request' class="method hidden"><code id='from_request.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request' class='fnname'>from_request</a>(request: &'a <a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a><'r>) -> <a class="type" href="https://api.rocket.rs/v0.4/rocket/request/from_request/type.Outcome.html" title="type rocket::request::from_request::Outcome">Outcome</a><Self, <a class="enum" href="../../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a>></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#191-201' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Derives an instance of <code>Self</code> from the incoming request metadata. <a href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request">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-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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestHeaders.html" title="struct rocket_cors::headers::AccessControlRequestHeaders">AccessControlRequestHeaders</a></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-2' class="type"><code id='Error.t-2'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<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-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#19-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
|
|
||||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "rocket_cors";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
|
@ -1,20 +0,0 @@
|
||||||
<!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="API documentation for the Rust `AccessControlRequestMethod` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, AccessControlRequestMethod"><title>rocket_cors::headers::AccessControlRequestMethod - 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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../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">☰</div><a href='../../rocket_cors/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct AccessControlRequestMethod</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-FromRequest%3C%27a%2C%20%27r%3E">FromRequest<'a, 'r></a><a href="#impl-FromStr">FromStr</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-AsResult%3CT%2C%20I%3E">AsResult<T, I></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-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-Typeable">Typeable</a></div></div><p class='location'><a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a></p><script>window.sidebarCurrent = {name: 'AccessControlRequestMethod', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/headers.rs.html#139' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a>::<wbr><a class="struct" href=''>AccessControlRequestMethod</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct AccessControlRequestMethod(pub <a class="struct" href="../../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a>);</pre></div><div class='docblock'><p>The <code>Access-Control-Request-Method</code> request header</p>
|
|
||||||
<p>You can use this as a rocket <a href="https://rocket.rs/guide/requests/#request-guards">Request Guard</a>
|
|
||||||
to ensure that the header is passed in correctly.</p>
|
|
||||||
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestMethod.html" title="struct rocket_cors::headers::AccessControlRequestMethod">AccessControlRequestMethod</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#138' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>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/rocket_cors/headers.rs.html#138' 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-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestMethod.html" title="struct rocket_cors::headers::AccessControlRequestMethod">AccessControlRequestMethod</a></code><a href='#impl-FromStr' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#141-147' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
|
|
||||||
</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(method: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#144-146' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-FromRequest%3C%27a%2C%20%27r%3E' class='impl'><code class='in-band'>impl<'a, 'r> <a class="trait" href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html" title="trait rocket::request::from_request::FromRequest">FromRequest</a><'a, 'r> for <a class="struct" href="../../rocket_cors/headers/struct.AccessControlRequestMethod.html" title="struct rocket_cors::headers::AccessControlRequestMethod">AccessControlRequestMethod</a></code><a href='#impl-FromRequest%3C%27a%2C%20%27r%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#149-161' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code></h4><div class='docblock'><p>The associated error to be returned if derivation fails.</p>
|
|
||||||
</div><h4 id='method.from_request' class="method hidden"><code id='from_request.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request' class='fnname'>from_request</a>(request: &'a <a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a><'r>) -> <a class="type" href="https://api.rocket.rs/v0.4/rocket/request/from_request/type.Outcome.html" title="type rocket::request::from_request::Outcome">Outcome</a><Self, <a class="enum" href="../../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a>></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#152-160' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Derives an instance of <code>Self</code> from the incoming request metadata. <a href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request">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-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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestMethod.html" title="struct rocket_cors::headers::AccessControlRequestMethod">AccessControlRequestMethod</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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestMethod.html" title="struct rocket_cors::headers::AccessControlRequestMethod">AccessControlRequestMethod</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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestMethod.html" title="struct rocket_cors::headers::AccessControlRequestMethod">AccessControlRequestMethod</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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestMethod.html" title="struct rocket_cors::headers::AccessControlRequestMethod">AccessControlRequestMethod</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><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="struct" href="../../rocket_cors/headers/struct.AccessControlRequestMethod.html" title="struct rocket_cors::headers::AccessControlRequestMethod">AccessControlRequestMethod</a></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-2' class="type"><code id='Error.t-2'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "rocket_cors";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
|
@ -1,35 +0,0 @@
|
||||||
<!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="API documentation for the Rust `HeaderFieldName` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, HeaderFieldName"><title>rocket_cors::headers::HeaderFieldName - 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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../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">☰</div><a href='../../rocket_cors/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct HeaderFieldName</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#deref-methods">Methods from Deref<Target=String></a><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-From%3C%26%27a%20str%3E">From<&'a str></a><a href="#impl-From%3CString%3E">From<String></a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CHeaderFieldName%3E">PartialEq<HeaderFieldName></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</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-AsResult%3CT%2C%20I%3E">AsResult<T, I></a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<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-Typeable">Typeable</a></div></div><p class='location'><a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a></p><script>window.sidebarCurrent = {name: 'HeaderFieldName', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/headers.rs.html#21-23' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a>::<wbr><a class="struct" href=''>HeaderFieldName</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct HeaderFieldName(_);</pre></div><div class='docblock'><p>A case insensitive header name</p>
|
|
||||||
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-From%3C%26%27a%20str%3E' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><&'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-From%3C%26%27a%20str%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#39-43' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: &'a <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#40-42' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CString%3E' class='impl'><code class='in-band'>impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-From%3CString%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#45-49' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> Self</code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#46-48' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>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#131-133' 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-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3CHeaderFieldName%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a>> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-PartialEq%3CHeaderFieldName%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
|
||||||
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</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="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#33-37' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.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/rocket_cors/headers.rs.html#34-36' 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-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="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>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/rocket_cors/headers.rs.html#19' 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-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-FromStr' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#51-57' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
|
|
||||||
</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#25-31' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
|
||||||
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#28-30' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
|
||||||
</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
|
|
||||||
</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#194-200' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#19' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#20' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#20' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../../src/rocket_cors/headers.rs.html#20' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code id='deserialize.v'>fn <a href='https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../../src/rocket_cors/headers.rs.html#20' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html#tymethod.deserialize">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-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="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</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="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</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="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</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="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><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="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
|
||||||
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
|
||||||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<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-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2171-2181' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2173-2180' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.102/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<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-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#19-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
|
|
||||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "rocket_cors";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
|
@ -1,2 +0,0 @@
|
||||||
<!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="API documentation for the Rust `HeaderFieldNamesSet` type in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, HeaderFieldNamesSet"><title>rocket_cors::headers::HeaderFieldNamesSet - 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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[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">☰</div><a href='../../rocket_cors/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition HeaderFieldNamesSet</p><div class="sidebar-elems"><p class='location'><a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a></p><script>window.sidebarCurrent = {name: 'HeaderFieldNamesSet', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/headers.rs.html#60' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='../index.html'>rocket_cors</a>::<wbr><a href='index.html'>headers</a>::<wbr><a class="type" href=''>HeaderFieldNamesSet</a></span></h1><pre class='rust typedef'>type HeaderFieldNamesSet = <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a>>;</pre><div class='docblock'><p>A set of case insensitive header names</p>
|
|
||||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "rocket_cors";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
|
@ -1,193 +0,0 @@
|
||||||
<!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="API documentation for the Rust `rocket_cors` crate."><meta name="keywords" content="rust, rustlang, rust-lang, rocket_cors"><title>rocket_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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate rocket_cors</p><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all rocket_cors's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'rocket_cors', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#1-2910' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>rocket_cors</a></span></h1><div class='docblock'><p><a href="https://travis-ci.org/lawliet89/rocket_cors"><img src="https://travis-ci.org/lawliet89/rocket_cors.svg" alt="Build Status" /></a>
|
|
||||||
<a href="https://github.com/lawliet89/rocket_cors"><img src="https://img.shields.io/github/tag/lawliet89/rocket_cors.svg" alt="Repository" /></a>
|
|
||||||
<a href="https://crates.io/crates/rocket_cors"><img src="https://img.shields.io/crates/v/rocket_cors.svg" alt="Crates.io" /></a></p>
|
|
||||||
<ul>
|
|
||||||
<li>Documentation: <a href="https://lawliet89.github.io/rocket_cors">master branch</a> | <a href="https://docs.rs/rocket_cors">stable</a></li>
|
|
||||||
</ul>
|
|
||||||
<p>Cross-origin resource sharing (CORS) for <a href="https://rocket.rs/">Rocket</a> applications</p>
|
|
||||||
<h2 id="requirements" class="section-header"><a href="#requirements">Requirements</a></h2>
|
|
||||||
<ul>
|
|
||||||
<li>Nightly Rust</li>
|
|
||||||
<li>Rocket >= 0.4</li>
|
|
||||||
</ul>
|
|
||||||
<p>If you are using Rocket 0.3, use the <code>0.3.0</code> version of this crate.</p>
|
|
||||||
<h3 id="nightly-rust" class="section-header"><a href="#nightly-rust">Nightly Rust</a></h3>
|
|
||||||
<p>Rocket requires nightly Rust. You should probably install Rust with
|
|
||||||
<a href="https://www.rustup.rs/">rustup</a>, then override the code directory to use nightly instead of
|
|
||||||
stable. See
|
|
||||||
<a href="https://rocket.rs/guide/getting-started/#installing-rust">installation instructions</a>.</p>
|
|
||||||
<p>In particular, <code>rocket_cors</code> is currently targetted for the latest <code>nightly</code>. Older nightlies
|
|
||||||
might work, but they are subject to the minimum that Rocket sets.</p>
|
|
||||||
<h2 id="installation" class="section-header"><a href="#installation">Installation</a></h2>
|
|
||||||
<p>Add the following to Cargo.toml:</p>
|
|
||||||
<pre><code class="language-toml">rocket_cors = "0.5.1"
|
|
||||||
</code></pre>
|
|
||||||
<p>To use the latest <code>master</code> branch, for example:</p>
|
|
||||||
<pre><code class="language-toml">rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" }
|
|
||||||
</code></pre>
|
|
||||||
<h2 id="features" class="section-header"><a href="#features">Features</a></h2>
|
|
||||||
<p>By default, a <code>serialization</code> feature is enabled in this crate that allows you to (de)serialize
|
|
||||||
the <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a> struct that is described below. If you would like to disable this, simply
|
|
||||||
change your <code>Cargo.toml</code> to:</p>
|
|
||||||
<pre><code class="language-toml">rocket_cors = { version = "0.5.1", default-features = false }
|
|
||||||
</code></pre>
|
|
||||||
<h2 id="usage" class="section-header"><a href="#usage">Usage</a></h2>
|
|
||||||
<p>Before you can add CORS responses to your application, you need to create a <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a>
|
|
||||||
struct that will hold the settings. Then, you need to create a <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> struct using
|
|
||||||
<a href="../rocket_cors/struct.CorsOptions.html#method.to_cors" title="`CorsOptions::to_cors`"><code>CorsOptions::to_cors</code></a> which will validate and optimise the settings for Rocket to use.</p>
|
|
||||||
<p>Each of the examples can be run off the repository via <code>cargo run --example xxx</code> where <code>xxx</code> is</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>fairing</code></li>
|
|
||||||
<li><code>guard</code></li>
|
|
||||||
<li><code>manual</code></li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="corsoptions-struct" class="section-header"><a href="#corsoptions-struct"><code>CorsOptions</code> Struct</a></h3>
|
|
||||||
<p>The <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a> struct contains the settings for CORS requests to be validated
|
|
||||||
and for responses to be generated. Defaults are defined for every field in the struct, and
|
|
||||||
are documented on the <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a> page. You can also deserialize
|
|
||||||
the struct from some format like JSON, YAML or TOML when the default <code>serialization</code> feature
|
|
||||||
is enabled.</p>
|
|
||||||
<h3 id="cors-struct" class="section-header"><a href="#cors-struct"><code>Cors</code> Struct</a></h3>
|
|
||||||
<p>The <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> struct is what will be used with Rocket. After creating or deserializing a
|
|
||||||
<a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a> struct, use <a href="../rocket_cors/struct.CorsOptions.html#method.to_cors" title="`CorsOptions::to_cors`"><code>CorsOptions::to_cors</code></a> to create a <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> struct.</p>
|
|
||||||
<h3 id="three-modes-of-operation" class="section-header"><a href="#three-modes-of-operation">Three modes of operation</a></h3>
|
|
||||||
<p>You can add CORS to your routes via one of three ways, in descending order of ease and in
|
|
||||||
ascending order of flexibility.</p>
|
|
||||||
<ul>
|
|
||||||
<li>Fairing (should only used exclusively)</li>
|
|
||||||
<li>Request Guard</li>
|
|
||||||
<li>Truly Manual</li>
|
|
||||||
</ul>
|
|
||||||
<p>Unfortunately, you cannot mix and match Fairing with any other of the methods, due to the
|
|
||||||
limitation of Rocket's fairing API. That is, the checks for Fairing will always happen first,
|
|
||||||
and if they fail, the route is never executed and so your guard or manual checks will never
|
|
||||||
get executed.</p>
|
|
||||||
<p>You can, however, mix and match guards and manual checks.</p>
|
|
||||||
<p>In summary:</p>
|
|
||||||
<table><thead><tr><th align="center"></th><th align="center">Fairing</th><th align="center">Request Guard</th><th align="center">Manual</th></tr></thead><tbody>
|
|
||||||
<tr><td align="center">Must apply to all routes</td><td align="center">✔</td><td align="center">✗</td><td align="center">✗</td></tr>
|
|
||||||
<tr><td align="center">Different settings for different routes</td><td align="center">✗</td><td align="center">✗</td><td align="center">✔</td></tr>
|
|
||||||
<tr><td align="center">May define custom OPTIONS routes</td><td align="center">✗</td><td align="center">✔</td><td align="center">✔</td></tr>
|
|
||||||
</tbody></table>
|
|
||||||
<h3 id="fairing" class="section-header"><a href="#fairing">Fairing</a></h3>
|
|
||||||
<p>Fairing is the easiest to use and also the most inflexible. You don't have to define <code>OPTIONS</code>
|
|
||||||
routes for your application, and the checks are done transparently.</p>
|
|
||||||
<p>However, you can only have one set of settings that must apply to all routes. You cannot opt
|
|
||||||
any route out of CORS checks.</p>
|
|
||||||
<p>To use this, simply create a <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> from <a href="../rocket_cors/struct.CorsOptions.html#method.to_cors" title="`CorsOptions::to_cors`"><code>CorsOptions::to_cors</code></a> and then
|
|
||||||
<a href="https://api.rocket.rs/rocket/struct.Rocket.html#method.attach"><code>attach</code></a> it to Rocket.</p>
|
|
||||||
<p>Refer to the <a href="https://github.com/lawliet89/rocket_cors/blob/master/examples/fairing.rs">example</a>.</p>
|
|
||||||
<h4 id="injected-route" class="section-header"><a href="#injected-route">Injected Route</a></h4>
|
|
||||||
<p>The fairing implementation will inject a route during attachment to Rocket. This route is used
|
|
||||||
to handle errors during CORS validation.</p>
|
|
||||||
<p>This is due to the limitation in Rocket's Fairing
|
|
||||||
<a href="https://rocket.rs/guide/fairings/">lifecycle</a>. Ideally, we want to validate the CORS request
|
|
||||||
during <code>on_request</code>, and if the validation fails, we want to stop the route from even executing
|
|
||||||
to</p>
|
|
||||||
<ol>
|
|
||||||
<li>prevent side effects</li>
|
|
||||||
<li>prevent resource usage from unnecessary computation</li>
|
|
||||||
</ol>
|
|
||||||
<p>The only way to do this is to hijack the request and route it to our own injected route to
|
|
||||||
handle errors. Rocket does not allow Fairings to stop the processing of a route.</p>
|
|
||||||
<p>You can configure the behaviour of the injected route through a couple of fields in the
|
|
||||||
<a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a>.</p>
|
|
||||||
<h3 id="request-guard" class="section-header"><a href="#request-guard">Request Guard</a></h3>
|
|
||||||
<p>Using request guard requires you to sacrifice the convenience of Fairings for being able to
|
|
||||||
opt some routes out of CORS checks and enforcement. <em>BUT</em> you are still restricted to only
|
|
||||||
one set of CORS settings and you have to mount additional routes to catch and process OPTIONS
|
|
||||||
requests. The <code>OPTIONS</code> routes are used for CORS preflight checks.</p>
|
|
||||||
<p>You will have to do the following:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Create a <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> from <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a> and during Rocket's ignite, add the struct to
|
|
||||||
Rocket's <a href="https://rocket.rs/guide/state/#managed-state">managed state</a>.</li>
|
|
||||||
<li>For all the routes that you want to enforce CORS on, you can mount either some
|
|
||||||
<a href="../rocket_cors/fn.catch_all_options_routes.html">catch all route</a> or define your own route for the OPTIONS
|
|
||||||
verb.</li>
|
|
||||||
<li>Then in all the routes you want to enforce CORS on, add a
|
|
||||||
<a href="https://rocket.rs/guide/requests/#request-guards">Request Guard</a> for the
|
|
||||||
<a href="../rocket_cors/struct.Guard.html"><code>Guard</code></a> struct in the route arguments. You should not wrap this in an
|
|
||||||
<code>Option</code> or <code>Result</code> because the guard will let non-CORS requests through and will take over
|
|
||||||
error handling in case of errors.</li>
|
|
||||||
<li>In your routes, to add CORS headers to your responses, use the appropriate functions on the
|
|
||||||
<a href="../rocket_cors/struct.Guard.html"><code>Guard</code></a> for a <code>Response</code> or a <code>Responder</code>.</li>
|
|
||||||
</ul>
|
|
||||||
<p>Refer to the <a href="https://github.com/lawliet89/rocket_cors/blob/master/examples/guard.rs">example</a>.</p>
|
|
||||||
<h2 id="truly-manual" class="section-header"><a href="#truly-manual">Truly Manual</a></h2>
|
|
||||||
<p>This mode is the most difficult to use but offers the most amount of flexibility.
|
|
||||||
You might have to understand how the library works internally to know how to use this mode.
|
|
||||||
In exchange, you can selectively choose which routes to offer CORS protection to, and you
|
|
||||||
can mix and match CORS settings for the routes. You can combine usage of this mode with
|
|
||||||
"guard" to offer a mix of ease of use and flexibility.</p>
|
|
||||||
<p>You really do not need to use this unless you have a truly ad-hoc need to respond to CORS
|
|
||||||
differently in a route. For example, you have a <code>ping</code> endpoint that allows all origins but
|
|
||||||
the rest of your routes do not.</p>
|
|
||||||
<h3 id="handler" class="section-header"><a href="#handler">Handler</a></h3>
|
|
||||||
<p>This mode requires that you pass in a closure that will be lazily evaluated once a CORS request
|
|
||||||
has been validated. If validation fails, the closure will not be run. You should put any code
|
|
||||||
that has any side effects or with an appreciable computation cost inside this handler.</p>
|
|
||||||
<h3 id="steps-to-perform" class="section-header"><a href="#steps-to-perform">Steps to perform:</a></h3>
|
|
||||||
<ul>
|
|
||||||
<li>You will first need to have a <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> struct ready. This struct can be borrowed with a lifetime
|
|
||||||
at least as long as <code>'r</code> which is the lifetime of a Rocket request. <code>'static</code> works too.
|
|
||||||
In this case, you might as well use the <code>Guard</code> method above and place the <code>Cors</code> struct in
|
|
||||||
Rocket's <a href="https://rocket.rs/guide/state/">state</a>.
|
|
||||||
Alternatively, you can create a <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> struct directly in the route.</li>
|
|
||||||
<li>Your routes <em>might</em> need to have a <code>'r</code> lifetime and return <code>impl Responder<'r></code>. See below.</li>
|
|
||||||
<li>Using the <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> struct, use either the
|
|
||||||
<a href="../rocket_cors/struct.Cors.html#method.respond_owned" title="`Cors::respond_owned`"><code>Cors::respond_owned</code></a> or
|
|
||||||
<a href="../rocket_cors/struct.Cors.html#method.respond_borrowed" title="`Cors::respond_borrowed`"><code>Cors::respond_borrowed</code></a> function and pass in a handler
|
|
||||||
that will be executed once CORS validation is successful.</li>
|
|
||||||
<li>Your handler will be passed a <a href="../rocket_cors/struct.Guard.html" title="`Guard`"><code>Guard</code></a> which you will have to use to
|
|
||||||
add CORS headers into your own response.</li>
|
|
||||||
<li>You will have to manually define your own <code>OPTIONS</code> routes.</li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="notes-about-route-lifetime" class="section-header"><a href="#notes-about-route-lifetime">Notes about route lifetime</a></h3>
|
|
||||||
<p>You might have to specify a <code>'r</code> lifetime in your routes and then return <code>impl Responder<'r></code>.
|
|
||||||
If you are not sure what to do, you can try to leave the lifetime out and then add it in
|
|
||||||
when the compiler complains.</p>
|
|
||||||
<p>Generally, you will need to manually annotate the lifetime for the following cases where
|
|
||||||
the compiler is unable to <a href="https://doc.rust-lang.org/beta/nomicon/lifetime-elision.html">elide</a>
|
|
||||||
the lifetime:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Your function arguments do not borrow anything.</li>
|
|
||||||
<li>Your function arguments borrow from more than one lifetime.</li>
|
|
||||||
<li>Your function arguments borrow from a lifetime that is shorter than the <code>'r</code> lifetime
|
|
||||||
required.</li>
|
|
||||||
</ul>
|
|
||||||
<p>You can see examples when the lifetime annotation is required (or not) in <code>examples/manual.rs</code>.</p>
|
|
||||||
<p>See the <a href="https://github.com/lawliet89/rocket_cors/blob/master/examples/manual.rs">example</a>.</p>
|
|
||||||
<h2 id="mixing-guard-and-manual" class="section-header"><a href="#mixing-guard-and-manual">Mixing Guard and Manual</a></h2>
|
|
||||||
<p>You can mix <code>Guard</code> and <code>Truly Manual</code> modes together for your application. For example, your
|
|
||||||
application might restrict the Origins that can access it, except for one <code>ping</code> route that
|
|
||||||
allows all access.</p>
|
|
||||||
<p>See the <a href="https://github.com/lawliet89/rocket_cors/blob/master/examples/guard.rs">example</a>.</p>
|
|
||||||
<h2 id="reference" class="section-header"><a href="#reference">Reference</a></h2>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://fetch.spec.whatwg.org/#cors-protocol">Fetch CORS Specification</a></li>
|
|
||||||
<li><a href="https://www.w3.org/TR/cors/">Supplanted W3C CORS Specification</a></li>
|
|
||||||
<li><a href="https://w3c.github.io/webappsec-cors-for-developers/#resources">Resource Advice</a></li>
|
|
||||||
</ul>
|
|
||||||
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
|
||||||
<table><tr class='module-item'><td><a class="mod" href="headers/index.html" title='rocket_cors::headers mod'>headers</a></td><td class='docblock-short'><p>CORS specific Request Headers</p>
|
|
||||||
</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
|
||||||
<table><tr class='module-item'><td><a class="struct" href="struct.Cors.html" title='rocket_cors::Cors struct'>Cors</a></td><td class='docblock-short'><p>Response generator and <a href="https://rocket.rs/guide/fairings/">Fairing</a> for CORS</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.CorsOptions.html" title='rocket_cors::CorsOptions struct'>CorsOptions</a></td><td class='docblock-short'><p>Configuration options for CORS request handling.</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Guard.html" title='rocket_cors::Guard struct'>Guard</a></td><td class='docblock-short'><p>A <a href="https://rocket.rs/guide/requests/#request-guards">request guard</a> to check CORS headers
|
|
||||||
before a route is run. Will not execute the route if checks fail.</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ManualResponder.html" title='rocket_cors::ManualResponder struct'>ManualResponder</a></td><td class='docblock-short'><p>A Manual Responder used in the "truly manual" mode of operation.</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Method.html" title='rocket_cors::Method struct'>Method</a></td><td class='docblock-short'><p>A wrapper type around <code>rocket::http::Method</code> to support serialization and deserialization</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Origins.html" title='rocket_cors::Origins struct'>Origins</a></td><td class='docblock-short'><p>Origins that are allowed to make CORS requests.</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Responder.html" title='rocket_cors::Responder struct'>Responder</a></td><td class='docblock-short'><p>A <a href="https://rocket.rs/guide/responses/#responder"><code>Responder</code></a> which will simply wraps another
|
|
||||||
<code>Responder</code> with CORS headers.</p>
|
|
||||||
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
|
||||||
<table><tr class='module-item'><td><a class="enum" href="enum.AllOrSome.html" title='rocket_cors::AllOrSome enum'>AllOrSome</a></td><td class='docblock-short'><p>An enum signifying that some of type T is allowed, or <code>All</code> (everything is allowed).</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Error.html" title='rocket_cors::Error enum'>Error</a></td><td class='docblock-short'><p>Errors during operations</p>
|
|
||||||
</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
|
||||||
<table><tr class='module-item'><td><a class="fn" href="fn.catch_all_options_routes.html" title='rocket_cors::catch_all_options_routes fn'>catch_all_options_routes</a></td><td class='docblock-short'><p>Returns "catch all" OPTIONS routes that you can mount to catch all OPTIONS request. Only works
|
|
||||||
if you have put a <code>Cors</code> struct into Rocket's managed state.</p>
|
|
||||||
</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
|
|
||||||
<table><tr class='module-item'><td><a class="type" href="type.AllowedHeaders.html" title='rocket_cors::AllowedHeaders type'>AllowedHeaders</a></td><td class='docblock-short'><p>A list of allowed headers</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="type" href="type.AllowedMethods.html" title='rocket_cors::AllowedMethods type'>AllowedMethods</a></td><td class='docblock-short'><p>A list of allowed methods</p>
|
|
||||||
</td></tr><tr class='module-item'><td><a class="type" href="type.AllowedOrigins.html" title='rocket_cors::AllowedOrigins type'>AllowedOrigins</a></td><td class='docblock-short'><p>A list of allowed origins. Either Some origins are allowed, or all origins are allowed.</p>
|
|
||||||
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1 +0,0 @@
|
||||||
initSidebarItems({"enum":[["AllOrSome","An enum signifying that some of type T is allowed, or `All` (everything is allowed)."],["Error","Errors during operations"]],"fn":[["catch_all_options_routes","Returns \"catch all\" OPTIONS routes that you can mount to catch all OPTIONS request. Only works if you have put a `Cors` struct into Rocket's managed state."]],"mod":[["headers","CORS specific Request Headers"]],"struct":[["Cors","Response generator and Fairing for CORS"],["CorsOptions","Configuration options for CORS request handling."],["Guard","A request guard to check CORS headers before a route is run. Will not execute the route if checks fail."],["ManualResponder","A Manual Responder used in the \"truly manual\" mode of operation."],["Method","A wrapper type around `rocket::http::Method` to support serialization and deserialization"],["Origins","Origins that are allowed to make CORS requests."],["Responder","A `Responder` which will simply wraps another `Responder` with CORS headers."]],"type":[["AllowedHeaders","A list of allowed headers"],["AllowedMethods","A list of allowed methods"],["AllowedOrigins","A list of allowed origins. Either Some origins are allowed, or all origins are allowed."]]});
|
|
|
@ -1,45 +0,0 @@
|
||||||
<!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="API documentation for the Rust `Cors` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, Cors"><title>rocket_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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-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="#methods">Methods</a><div class="sidebar-links"><a href="#method.from_options">from_options</a><a href="#method.respond_borrowed">respond_borrowed</a><a href="#method.respond_owned">respond_owned</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Fairing">Fairing</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-AsResult%3CT%2C%20I%3E">AsResult<T, I></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-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-Typeable">Typeable</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'Cors', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#1164-1174' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>rocket_cors</a>::<wbr><a class="struct" href=''>Cors</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>Response generator and <a href="https://rocket.rs/guide/fairings/">Fairing</a> for CORS</p>
|
|
||||||
<p>This struct can be as Fairing or in an ad-hoc manner to generate CORS response. See the
|
|
||||||
documentation at the <a href="index.html">crate root</a> for usage information.</p>
|
|
||||||
<p>This struct can be created by using <a href="../rocket_cors/struct.CorsOptions.html#method.to_cors" title="`CorsOptions::to_cors`"><code>CorsOptions::to_cors</code></a> or <a href="../rocket_cors/struct.Cors.html#method.from_options" title="`Cors::from_options`"><code>Cors::from_options</code></a>.</p>
|
|
||||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#1176-1236' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from_options' class="method"><code id='from_options.v'>pub fn <a href='#method.from_options' class='fnname'>from_options</a>(options: &<a class="struct" href="../rocket_cors/struct.CorsOptions.html" title="struct rocket_cors::CorsOptions">CorsOptions</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, <a class="enum" href="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a>></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1178-1194' title='goto source code'>[src]</a></h4><div class='docblock'><p>Create a <code>Cors</code> struct from a <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a></p>
|
|
||||||
</div><h4 id='method.respond_owned' class="method"><code id='respond_owned.v'>pub fn <a href='#method.respond_owned' class='fnname'>respond_owned</a><'r, F, R>(<br> self, <br> handler: F<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../rocket_cors/struct.ManualResponder.html" title="struct rocket_cors::ManualResponder">ManualResponder</a><'r, F, R>, <a class="enum" href="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r>) -> R + 'r,<br> R: <a class="trait" href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html" title="trait rocket::response::responder::Responder">Responder</a><'r>, </span></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1206-1212' title='goto source code'>[src]</a></h4><div class='docblock'><p>Manually respond to a request with CORS checks and headers using an Owned <code>Cors</code>.</p>
|
|
||||||
<p>Use this variant when your <code>Cors</code> struct will not live at least as long as the whole <code>'r</code>
|
|
||||||
lifetime of the request.</p>
|
|
||||||
<p>After the CORS checks are done, the passed in handler closure will be run to generate a
|
|
||||||
final response. You will have to merge your response with the <code>Guard</code> that you have been
|
|
||||||
passed in to include the CORS headers.</p>
|
|
||||||
<p>See the documentation at the <a href="index.html">crate root</a> for usage information.</p>
|
|
||||||
</div><h4 id='method.respond_borrowed' class="method"><code id='respond_borrowed.v'>pub fn <a href='#method.respond_borrowed' class='fnname'>respond_borrowed</a><'r, F, R>(<br> &'r self, <br> handler: F<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../rocket_cors/struct.ManualResponder.html" title="struct rocket_cors::ManualResponder">ManualResponder</a><'r, F, R>, <a class="enum" href="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r>) -> R + 'r,<br> R: <a class="trait" href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html" title="trait rocket::response::responder::Responder">Responder</a><'r>, </span></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1226-1235' title='goto source code'>[src]</a></h4><div class='docblock'><p>Manually respond to a request with CORS checks and headers using a borrowed <code>Cors</code>.</p>
|
|
||||||
<p>Use this variant when your <code>Cors</code> struct will live at least as long as the whole <code>'r</code>
|
|
||||||
lifetime of the request. If you are getting your <code>Cors</code> from Rocket's state, you will have
|
|
||||||
to use the <a href="https://api.rocket.rs/rocket/struct.State.html#method.inner"><code>inner</code> function</a>
|
|
||||||
to get a longer borrowed lifetime.</p>
|
|
||||||
<p>After the CORS checks are done, the passed in handler closure will be run to generate a
|
|
||||||
final response. You will have to merge your response with the <code>Guard</code> that you have been
|
|
||||||
passed in to include the CORS headers.</p>
|
|
||||||
<p>See the documentation at the <a href="index.html">crate root</a> for usage information.</p>
|
|
||||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#1163' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1163' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>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#131-133' 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="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#1163' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>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/rocket_cors/lib.rs.html#1163' 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-Fairing' class='impl'><code class='in-band'>impl <a class="trait" href="https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html" title="trait rocket::fairing::Fairing">Fairing</a> for <a class="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</a></code><a href='#impl-Fairing' class='anchor'></a><a class='srclink' href='../src/rocket_cors/fairing.rs.html#93-131' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.info' class="method hidden"><code id='info.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#tymethod.info' class='fnname'>info</a>(&self) -> <a class="struct" href="https://api.rocket.rs/v0.4/rocket/fairing/info_kind/struct.Info.html" title="struct rocket::fairing::info_kind::Info">Info</a></code><a class='srclink' href='../src/rocket_cors/fairing.rs.html#94-101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns an [<code>Info</code>] structure containing the <code>name</code> and [<code>Kind</code>] of this fairing. The <code>name</code> can be any arbitrary string. <code>Kind</code> must be an <code>or</code>d set of <code>Kind</code> variants. <a href="https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#tymethod.info">Read more</a></p>
|
|
||||||
</div><h4 id='method.on_attach' class="method hidden"><code id='on_attach.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#method.on_attach' class='fnname'>on_attach</a>(&self, rocket: <a class="struct" href="https://api.rocket.rs/v0.4/rocket/rocket/struct.Rocket.html" title="struct rocket::rocket::Rocket">Rocket</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://api.rocket.rs/v0.4/rocket/rocket/struct.Rocket.html" title="struct rocket::rocket::Rocket">Rocket</a>, <a class="struct" href="https://api.rocket.rs/v0.4/rocket/rocket/struct.Rocket.html" title="struct rocket::rocket::Rocket">Rocket</a>></code><a class='srclink' href='../src/rocket_cors/fairing.rs.html#103-108' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The attach callback. Returns <code>Ok</code> if launch should proceed and <code>Err</code> if launch should be aborted. <a href="https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#method.on_attach">Read more</a></p>
|
|
||||||
</div><h4 id='method.on_request' class="method hidden"><code id='on_request.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#method.on_request' class='fnname'>on_request</a>(&self, request: &mut <a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a>, _: &<a class="struct" href="https://api.rocket.rs/v0.4/rocket/data/data/struct.Data.html" title="struct rocket::data::data::Data">Data</a>)</code><a class='srclink' href='../src/rocket_cors/fairing.rs.html#110-122' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The request callback. <a href="https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#method.on_request">Read more</a></p>
|
|
||||||
</div><h4 id='method.on_response' class="method hidden"><code id='on_response.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#method.on_response' class='fnname'>on_response</a>(&self, request: &<a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a>, response: &mut <a class="struct" href="https://api.rocket.rs/v0.4/rocket/response/response/struct.Response.html" title="struct rocket::response::response::Response">Response</a>)</code><a class='srclink' href='../src/rocket_cors/fairing.rs.html#124-130' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The response callback. <a href="https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#method.on_response">Read more</a></p>
|
|
||||||
</div><h4 id='method.on_launch' class="method hidden"><code id='on_launch.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#method.on_launch' class='fnname'>on_launch</a>(&self, rocket: &<a class="struct" href="https://api.rocket.rs/v0.4/rocket/rocket/struct.Rocket.html" title="struct rocket::rocket::Rocket">Rocket</a>)</code><a class='srclink' href='https://api.rocket.rs/v0.4/src/rocket/fairing/mod.rs.html#385' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>The launch callback. <a href="https://api.rocket.rs/v0.4/rocket/fairing/trait.Fairing.html#method.on_launch">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-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="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</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="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</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="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</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="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><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="struct" href="../rocket_cors/struct.Cors.html" title="struct rocket_cors::Cors">Cors</a></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
|
||||||
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
|
||||||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
File diff suppressed because one or more lines are too long
|
@ -1,27 +0,0 @@
|
||||||
<!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="API documentation for the Rust `Guard` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, Guard"><title>rocket_cors::Guard - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Guard</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.responder">responder</a><a href="#method.response">response</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-FromRequest%3C%27a%2C%20%27r%3E">FromRequest<'a, 'r></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-AsResult%3CT%2C%20I%3E">AsResult<T, I></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-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-Typeable">Typeable</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'Guard', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#1431-1434' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>rocket_cors</a>::<wbr><a class="struct" href=''>Guard</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Guard<'r> { /* fields omitted */ }</pre></div><div class='docblock'><p>A <a href="https://rocket.rs/guide/requests/#request-guards">request guard</a> to check CORS headers
|
|
||||||
before a route is run. Will not execute the route if checks fail.</p>
|
|
||||||
<p>See the documentation at the <a href="index.html">crate root</a> for usage information.</p>
|
|
||||||
<p>You should not wrap this in an
|
|
||||||
<code>Option</code> or <code>Result</code> because the guard will let non-CORS requests through and will take over
|
|
||||||
error handling in case of errors.
|
|
||||||
In essence, this is just a wrapper around <code>Response</code> with a <code>'r</code> borrowed lifetime so users
|
|
||||||
don't have to keep specifying the lifetimes in their routes</p>
|
|
||||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<'r> <a class="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#1436-1457' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.responder' class="method"><code id='responder.v'>pub fn <a href='#method.responder' class='fnname'>responder</a><R: <a class="trait" href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html" title="trait rocket::response::responder::Responder">Responder</a><'r>>(self, responder: R) -> <a class="struct" href="../rocket_cors/struct.Responder.html" title="struct rocket_cors::Responder">Responder</a><'r, R></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1446-1448' title='goto source code'>[src]</a></h4><div class='docblock'><p>Consumes the Guard and return a <code>Responder</code> that wraps a
|
|
||||||
provided <code>rocket:response::Responder</code> with CORS headers</p>
|
|
||||||
</div><h4 id='method.response' class="method"><code id='response.v'>pub fn <a href='#method.response' class='fnname'>response</a>(&self, base: <a class="struct" href="https://api.rocket.rs/v0.4/rocket/response/response/struct.Response.html" title="struct rocket::response::response::Response">Response</a><'r>) -> <a class="struct" href="https://api.rocket.rs/v0.4/rocket/response/response/struct.Response.html" title="struct rocket::response::response::Response">Response</a><'r></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1454-1456' title='goto source code'>[src]</a></h4><div class='docblock'><p>Merge a <code>rocket::Response</code> with this CORS Guard. This is usually used in the final step
|
|
||||||
of a route to return a value for the route.</p>
|
|
||||||
<p>This will overwrite any existing CORS headers</p>
|
|
||||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-FromRequest%3C%27a%2C%20%27r%3E' class='impl'><code class='in-band'>impl<'a, 'r> <a class="trait" href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html" title="trait rocket::request::from_request::FromRequest">FromRequest</a><'a, 'r> for <a class="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r></code><a href='#impl-FromRequest%3C%27a%2C%20%27r%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#1459-1476' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../rocket_cors/enum.Error.html" title="enum rocket_cors::Error">Error</a></code></h4><div class='docblock'><p>The associated error to be returned if derivation fails.</p>
|
|
||||||
</div><h4 id='method.from_request' class="method hidden"><code id='from_request.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request' class='fnname'>from_request</a>(request: &'a <a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a><'r>) -> <a class="type" href="https://api.rocket.rs/v0.4/rocket/request/from_request/type.Outcome.html" title="type rocket::request::from_request::Outcome">Outcome</a><Self, Self::<a class="type" href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#associatedtype.Error" title="type rocket::request::from_request::FromRequest::Error">Error</a>></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1462-1475' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Derives an instance of <code>Self</code> from the incoming request metadata. <a href="https://api.rocket.rs/v0.4/rocket/request/from_request/trait.FromRequest.html#tymethod.from_request">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-Send' class='impl'><code class='in-band'>impl<'r> <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="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r></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<'r> <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="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r></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<'r> <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="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r></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<'r> <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="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<'r> <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="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-2' class="type"><code id='Error.t-2'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<!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="API documentation for the Rust `ManualResponder` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, ManualResponder"><title>rocket_cors::ManualResponder - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ManualResponder</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Responder%3C%27r%3E">Responder<'r></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-AsResult%3CT%2C%20I%3E">AsResult<T, I></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-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-Typeable">Typeable</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'ManualResponder', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#1527-1531' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>rocket_cors</a>::<wbr><a class="struct" href=''>ManualResponder</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct ManualResponder<'r, F, R> { /* fields omitted */ }</pre></div><div class='docblock'><p>A Manual Responder used in the "truly manual" mode of operation.</p>
|
|
||||||
<p>See the documentation at the <a href="index.html">crate root</a> for usage information.</p>
|
|
||||||
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Responder%3C%27r%3E' class='impl'><code class='in-band'>impl<'r, F, R> <a class="trait" href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html" title="trait rocket::response::responder::Responder">Responder</a><'r> for <a class="struct" href="../rocket_cors/struct.ManualResponder.html" title="struct rocket_cors::ManualResponder">ManualResponder</a><'r, F, R> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="struct" href="../rocket_cors/struct.Guard.html" title="struct rocket_cors::Guard">Guard</a><'r>) -> R + 'r,<br> R: <a class="trait" href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html" title="trait rocket::response::responder::Responder">Responder</a><'r>, </span></code><a href='#impl-Responder%3C%27r%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#1557-1572' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.respond_to' class="method hidden"><code id='respond_to.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html#tymethod.respond_to' class='fnname'>respond_to</a>(self, request: &<a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a>) -> <a class="type" href="https://api.rocket.rs/v0.4/rocket/response/type.Result.html" title="type rocket::response::Result">Result</a><'r></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1562-1571' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns <code>Ok</code> if a <code>Response</code> could be generated successfully. Otherwise, returns an <code>Err</code> with a failing <code>Status</code>. <a href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html#tymethod.respond_to">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-Send' class='impl'><code class='in-band'>impl<'r, F, R> <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="struct" href="../rocket_cors/struct.ManualResponder.html" title="struct rocket_cors::ManualResponder">ManualResponder</a><'r, F, R> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></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<'r, F, R> <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="struct" href="../rocket_cors/struct.ManualResponder.html" title="struct rocket_cors::ManualResponder">ManualResponder</a><'r, F, R> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></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<'r, F, R> <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="struct" href="../rocket_cors/struct.ManualResponder.html" title="struct rocket_cors::ManualResponder">ManualResponder</a><'r, F, R> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></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<'r, F, R> !<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="struct" href="../rocket_cors/struct.ManualResponder.html" title="struct rocket_cors::ManualResponder">ManualResponder</a><'r, F, R></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<'r, F, R> !<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="struct" href="../rocket_cors/struct.ManualResponder.html" title="struct rocket_cors::ManualResponder">ManualResponder</a><'r, F, R></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<!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="API documentation for the Rust `Method` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, Method"><title>rocket_cors::Method - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Method</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#deref-methods">Methods from Deref<Target=Method></a><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Display">Display</a><a href="#impl-Eq">Eq</a><a href="#impl-From%3CMethod%3E">From<Method></a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-PartialEq%3CMethod%3E">PartialEq<Method></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</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-AsResult%3CT%2C%20I%3E">AsResult<T, I></a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<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-Typeable">Typeable</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'Method', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#489' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>rocket_cors</a>::<wbr><a class="struct" href=''>Method</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Method(_);</pre></div><div class='docblock'><p>A wrapper type around <code>rocket::http::Method</code> to support serialization and deserialization</p>
|
|
||||||
</div><h2 id='deref-methods' class='small-section-header'>Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = Method><a href='#deref-methods' class='anchor'></a></h2><div class='impl-items'></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-From%3CMethod%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Method> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-From%3CMethod%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#508-512' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(method: Method) -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#509-511' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>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#131-133' 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-Copy' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Copy' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3CMethod%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a>> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-PartialEq%3CMethod%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
|
||||||
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</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="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Display' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#514-518' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.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/rocket_cors/lib.rs.html#515-517' 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-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="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt-1' class="method hidden"><code id='fmt.v-1'>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/rocket_cors/lib.rs.html#488' 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-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html" title="trait core::str::FromStr">FromStr</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-FromStr' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#491-498' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
|
|
||||||
</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>fn <a href='https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#associatedtype.Err" title="type core::str::FromStr::Err">Err</a>></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#494-497' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#500-506' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = Method</code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
|
||||||
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#503-505' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
|
||||||
</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a><__H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>__H)</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
|
|
||||||
</div><h4 id='method.hash_slice' class="method hidden"><code id='hash_slice.v'>fn <a href='https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a><H>(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>H) <span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>, </span></code><span class='since' title='Stable since Rust version 1.3.0'>1.3.0</span><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#194-200' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#488' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#529-536' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><S>(&self, serializer: S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><S::<a class="type" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, S::<a class="type" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> S: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#530-535' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#538-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code id='deserialize.v'>fn <a href='https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><D>(deserializer: D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a>, D::<a class="type" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> D: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#539-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html#tymethod.deserialize">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-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="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</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="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</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="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</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="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><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="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method hidden"><code id='from.v-1'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
|
||||||
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
|
||||||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-ToString' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<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-ToString' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2171-2181' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.to_string' class="method hidden"><code id='to_string.v'>default fn <a href='https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string' class='fnname'>to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2173-2180' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.102/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<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-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#19-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
|
|
||||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,84 +0,0 @@
|
||||||
<!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="API documentation for the Rust `Origins` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, Origins"><title>rocket_cors::Origins - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Origins</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.allow_null">allow_null</a><a href="#structfield.exact">exact</a><a href="#structfield.regex">regex</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-PartialEq%3COrigins%3E">PartialEq<Origins></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</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-AsResult%3CT%2C%20I%3E">AsResult<T, I></a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-Typeable">Typeable</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'Origins', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#744-788' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>rocket_cors</a>::<wbr><a class="struct" href=''>Origins</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Origins {
|
|
||||||
pub allow_null: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
|
|
||||||
pub exact: <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/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>,
|
|
||||||
pub regex: <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/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>,
|
|
||||||
}</pre></div><div class='docblock'><p>Origins that are allowed to make CORS requests.</p>
|
|
||||||
<p>An origin is defined according to the defined
|
|
||||||
<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin">syntax</a>.</p>
|
|
||||||
<p>Origins can be specified as an exact match or using regex.</p>
|
|
||||||
<p>These Origins are specified as logical <code>ORs</code>. That is, if any of the origins match, the entire
|
|
||||||
request is considered to be valid.</p>
|
|
||||||
<p>Exact matches are matched exactly with the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<p>Regular expressions are tested for matches against the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<h1 id="opaque-origins" class="section-header"><a href="#opaque-origins">Opaque Origins</a></h1>
|
|
||||||
<p>The <a href="https://html.spec.whatwg.org/multipage/origin.html">specification</a> defines an Opaque Origin
|
|
||||||
as one that cannot be recreated. You can refer to the source code for the <a href="https://docs.rs/url/2.0.0/url/struct.Url.html#method.origin" title="`url::Url::origin`"><code>url::Url::origin</code></a>
|
|
||||||
method to see how an Opaque Origin is determined. Examples of Opaque origins might include
|
|
||||||
schemes like <code>file://</code> or Browser specific schemes like <code>"moz-extension://</code> or
|
|
||||||
<code>chrome-extension://</code>.</p>
|
|
||||||
<p>Opaque Origins cannot be matched exactly. You must use Regex to match Opaque Origins. If you
|
|
||||||
attempt to create <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> from <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a>, you will get an error.</p>
|
|
||||||
<h1 id="warning-about-regex-expressions" class="section-header"><a href="#warning-about-regex-expressions">Warning about Regex expressions</a></h1>
|
|
||||||
<p>By default, regex expressions are
|
|
||||||
<a href="https://docs.rs/regex/1.1.2/regex/struct.RegexSet.html#method.is_match">unanchored</a>.</p>
|
|
||||||
<p>This means that if the regex does not start with <code>^</code> or <code>\A</code>, or end with <code>$</code> or <code>\z</code>,
|
|
||||||
then it is permitted to match anywhere in the text. You are encouraged to use the anchors when
|
|
||||||
crafting your Regex expressions.</p>
|
|
||||||
</div><h2 id='fields' class='fields small-section-header'>
|
|
||||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.allow_null" class="structfield small-section-header"><a href="#structfield.allow_null" class="anchor field"></a><code id="allow_null.v">allow_null: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><div class='docblock'><p>Whether null origins are accepted</p>
|
|
||||||
</div><span id="structfield.exact" class="structfield small-section-header"><a href="#structfield.exact" class="anchor field"></a><code id="exact.v">exact: <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/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>></code></span><div class='docblock'><p>Origins that must be matched exactly as provided.</p>
|
|
||||||
<p>These <strong>must</strong> be valid URL strings that will be parsed and validated when
|
|
||||||
creating <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a>.</p>
|
|
||||||
<p>Exact matches are matched exactly with the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<h1 id="opaque-origins-1" class="section-header"><a href="#opaque-origins-1">Opaque Origins</a></h1>
|
|
||||||
<p>The <a href="https://html.spec.whatwg.org/multipage/origin.html">specification</a> defines an Opaque Origin
|
|
||||||
as one that cannot be recreated. You can refer to the source code for the <a href="https://docs.rs/url/2.0.0/url/struct.Url.html#method.origin" title="`url::Url::origin`"><code>url::Url::origin</code></a>
|
|
||||||
method to see how an Opaque Origin is determined. Examples of Opaque origins might include
|
|
||||||
schemes like <code>file://</code> or Browser specific schemes like <code>"moz-extension://</code> or
|
|
||||||
<code>chrome-extension://</code>.</p>
|
|
||||||
<p>Opaque Origins cannot be matched exactly. You must use Regex to match Opaque Origins. If you
|
|
||||||
attempt to create <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> from <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a>, you will get an error.</p>
|
|
||||||
</div><span id="structfield.regex" class="structfield small-section-header"><a href="#structfield.regex" class="anchor field"></a><code id="regex.v">regex: <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/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>></code></span><div class='docblock'><p>Origins that will be matched via <strong>any</strong> regex in this list.</p>
|
|
||||||
<p>These <strong>must</strong> be valid Regex that will be parsed and validated when creating <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a>.</p>
|
|
||||||
<p>The regex will be matched according to the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/#ascii-serialisation-of-an-origin">ASCII serialization</a>
|
|
||||||
of the incoming Origin.</p>
|
|
||||||
<p>For more information on the syntax of Regex in Rust, see the
|
|
||||||
<a href="https://docs.rs/regex">documentation</a>.</p>
|
|
||||||
<p>Regular expressions are tested for matches against the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<h1 id="warning-about-regex-expressions-1" class="section-header"><a href="#warning-about-regex-expressions-1">Warning about Regex expressions</a></h1>
|
|
||||||
<p>By default, regex expressions are
|
|
||||||
<a href="https://docs.rs/regex/1.1.2/regex/struct.RegexSet.html#method.is_match">unanchored</a>.</p>
|
|
||||||
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_from' class="method hidden"><code id='clone_from.v'>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#131-133' 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-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-PartialEq%3COrigins%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a>> for <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-PartialEq%3COrigins%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, other: &<a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
|
||||||
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &<a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</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="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>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/rocket_cors/lib.rs.html#741' 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-StructuralPartialEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-StructuralPartialEq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-StructuralEq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralEq.html" title="trait core::marker::StructuralEq">StructuralEq</a> for <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-StructuralEq' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#741' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Serialize' class='impl'><code class='in-band'>impl <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-Serialize' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#742' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.serialize' class="method hidden"><code id='serialize.v'>fn <a href='https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html#tymethod.serialize' class='fnname'>serialize</a><__S>(&self, __serializer: __S) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><__S::<a class="type" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, __S::<a class="type" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html#associatedtype.Error" title="type serde::ser::Serializer::Error">Error</a>> <span class="where fmt-newline">where<br> __S: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>, </span></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#742' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.102/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-Deserialize%3C%27de%3E' class='impl'><code class='in-band'>impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a> <span class="where fmt-newline">where<br> <a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>, </span></code><a href='#impl-Deserialize%3C%27de%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#742' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.deserialize' class="method hidden"><code id='deserialize.v'>fn <a href='https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html#tymethod.deserialize' class='fnname'>deserialize</a><__D>(__deserializer: __D) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self, __D::<a class="type" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserializer.html#associatedtype.Error" title="type serde::de::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> __D: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#742' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html#tymethod.deserialize">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-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="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</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="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</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="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</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="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><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="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
|
||||||
</div><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
|
||||||
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
|
|
||||||
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-DeserializeOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://docs.rs/serde/1.0.102/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>, </span></code><a href='#impl-DeserializeOwned' class='anchor'></a><a class='srclink' href='https://docs.rs/serde/1.0.102/src/serde/de/mod.rs.html#604' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div><h3 id='impl-Equivalent%3CK%3E' class='impl'><code class='in-band'>impl<Q, K> <a class="trait" href="https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html" title="trait indexmap::equivalent::Equivalent">Equivalent</a><K> for Q <span class="where fmt-newline">where<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><Q> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> Q: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> + ?<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-Equivalent%3CK%3E' class='anchor'></a><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#19-27' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.equivalent' class="method hidden"><code id='equivalent.v'>fn <a href='https://docs.rs/indexmap/1/indexmap/equivalent/trait.Equivalent.html#tymethod.equivalent' class='fnname'>equivalent</a>(&self, key: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>K) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='https://docs.rs/indexmap/1/src/indexmap/equivalent.rs.html#24-26' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Compare self to <code>key</code> and return <code>true</code> if they are equal.</p>
|
|
||||||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,30 +0,0 @@
|
||||||
<!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="API documentation for the Rust `Responder` struct in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, Responder"><title>rocket_cors::Responder - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Responder</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Responder%3C%27r%3E">Responder<'r></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-AsResult%3CT%2C%20I%3E">AsResult<T, I></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-Into%3CU%3E">Into<U></a><a href="#impl-IntoCollection%3CT%3E">IntoCollection<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-Typeable">Typeable</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'Responder', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#1495-1499' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='index.html'>rocket_cors</a>::<wbr><a class="struct" href=''>Responder</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Responder<'r, R> { /* fields omitted */ }</pre></div><div class='docblock'><p>A <a href="https://rocket.rs/guide/responses/#responder"><code>Responder</code></a> which will simply wraps another
|
|
||||||
<code>Responder</code> with CORS headers.</p>
|
|
||||||
<p>The following CORS headers will be overwritten:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>Access-Control-Allow-Origin</code></li>
|
|
||||||
<li><code>Access-Control-Expose-Headers</code></li>
|
|
||||||
<li><code>Access-Control-Max-Age</code></li>
|
|
||||||
<li><code>Access-Control-Allow-Credentials</code></li>
|
|
||||||
<li><code>Access-Control-Allow-Methods</code></li>
|
|
||||||
<li><code>Access-Control-Allow-Headers</code></li>
|
|
||||||
</ul>
|
|
||||||
<p>The following headers will be merged:</p>
|
|
||||||
<ul>
|
|
||||||
<li><code>Vary</code></li>
|
|
||||||
</ul>
|
|
||||||
<p>See the documentation at the <a href="index.html">crate root</a> for usage information.</p>
|
|
||||||
</div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl<'r, R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>> <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="struct" href="../rocket_cors/struct.Responder.html" title="struct rocket_cors::Responder">Responder</a><'r, R></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#1494' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>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/rocket_cors/lib.rs.html#1494' 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-Responder%3C%27r%3E' class='impl'><code class='in-band'>impl<'r, R: <a class="trait" href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html" title="trait rocket::response::responder::Responder">Responder</a><'r>> <a class="trait" href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html" title="trait rocket::response::responder::Responder">Responder</a><'r> for <a class="struct" href="../rocket_cors/struct.Responder.html" title="struct rocket_cors::Responder">Responder</a><'r, R></code><a href='#impl-Responder%3C%27r%3E' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#1518-1522' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.respond_to' class="method hidden"><code id='respond_to.v'>fn <a href='https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html#tymethod.respond_to' class='fnname'>respond_to</a>(self, request: &<a class="struct" href="https://api.rocket.rs/v0.4/rocket/request/request/struct.Request.html" title="struct rocket::request::request::Request">Request</a>) -> <a class="type" href="https://api.rocket.rs/v0.4/rocket/response/type.Result.html" title="type rocket::response::Result">Result</a><'r></code><a class='srclink' href='../src/rocket_cors/lib.rs.html#1519-1521' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns <code>Ok</code> if a <code>Response</code> could be generated successfully. Otherwise, returns an <code>Err</code> with a failing <code>Status</code>. <a href="https://api.rocket.rs/v0.4/rocket/response/responder/trait.Responder.html#tymethod.respond_to">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-Send' class='impl'><code class='in-band'>impl<'r, R> !<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="struct" href="../rocket_cors/struct.Responder.html" title="struct rocket_cors::Responder">Responder</a><'r, R></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<'r, R> !<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="struct" href="../rocket_cors/struct.Responder.html" title="struct rocket_cors::Responder">Responder</a><'r, R></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<'r, R> !<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="struct" href="../rocket_cors/struct.Responder.html" title="struct rocket_cors::Responder">Responder</a><'r, R></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<'r, R> !<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="struct" href="../rocket_cors/struct.Responder.html" title="struct rocket_cors::Responder">Responder</a><'r, R></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<'r, R> !<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="struct" href="../rocket_cors/struct.Responder.html" title="struct rocket_cors::Responder">Responder</a><'r, R></code><a href='#impl-RefUnwindSafe' 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-Into%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#541-546' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-545' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#550-552' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#551' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#581-587' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#584-586' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
|
||||||
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#569-576' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
|
||||||
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#573-575' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</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#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>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#214' 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>
|
|
||||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</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-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
|
||||||
</div></div><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#98-100' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>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#99' 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-Typeable' class='impl'><code class='in-band'>impl<T> Typeable for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a>, </span></code><a href='#impl-Typeable' class='anchor'></a></h3><div class='impl-items'><h4 id='method.get_type' class="method hidden"><code id='get_type.v'>fn <a href='#method.get_type' class='fnname'>get_type</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></h4><div class='docblock hidden'><p>Get the <code>TypeId</code> of this object.</p>
|
|
||||||
</div></div><h3 id='impl-IntoCollection%3CT%3E' class='impl'><code class='in-band'>impl<T> IntoCollection<T> for T</code><a href='#impl-IntoCollection%3CT%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.into_collection' class="method hidden"><code id='into_collection.v'>fn <a href='#method.into_collection' class='fnname'>into_collection</a><A>(self) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = T>, </span></code></h4><div class='docblock hidden'><p>Converts <code>self</code> into a collection.</p>
|
|
||||||
</div><h4 id='method.mapped' class="method hidden"><code id='mapped.v'>fn <a href='#method.mapped' class='fnname'>mapped</a><U, F, A>(self, f: F) -> SmallVec<A> <span class="where fmt-newline">where<br> A: Array<Item = U>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T) -> U, </span></code></h4></div><h3 id='impl-AsResult%3CT%2C%20I%3E' class='impl'><code class='in-band'>impl<T, I> AsResult<T, I> for T <span class="where fmt-newline">where<br> I: Input, </span></code><a href='#impl-AsResult%3CT%2C%20I%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.as_result' class="method hidden"><code id='as_result.v'>fn <a href='#method.as_result' class='fnname'>as_result</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, ParseErr<I>></code></h4></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,10 +0,0 @@
|
||||||
<!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="API documentation for the Rust `AllowedHeaders` type in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, AllowedHeaders"><title>rocket_cors::AllowedHeaders - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition AllowedHeaders</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.all">all</a><a href="#method.some">some</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'AllowedHeaders', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#904' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='index.html'>rocket_cors</a>::<wbr><a class="type" href=''>AllowedHeaders</a></span></h1><pre class='rust typedef'>type AllowedHeaders = <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../rocket_cors/headers/struct.HeaderFieldName.html" title="struct rocket_cors::headers::HeaderFieldName">HeaderFieldName</a>>>;</pre><div class='docblock'><p>A list of allowed headers</p>
|
|
||||||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
|
||||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket_cors</span>::<span class="ident">AllowedHeaders</span>;
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">all_headers</span> <span class="op">=</span> <span class="ident">AllowedHeaders</span>::<span class="ident">all</span>();
|
|
||||||
<span class="kw">let</span> <span class="ident">some_headers</span> <span class="op">=</span> <span class="ident">AllowedHeaders</span>::<span class="ident">some</span>(<span class="kw-2">&</span>[<span class="string">"Authorization"</span>, <span class="string">"Accept"</span>]);</pre></div>
|
|
||||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="type" href="../rocket_cors/type.AllowedHeaders.html" title="type rocket_cors::AllowedHeaders">AllowedHeaders</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#906-916' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.some' class="method"><code id='some.v'>pub fn <a href='#method.some' class='fnname'>some</a>(headers: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a>&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#908-910' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allow some headers</p>
|
|
||||||
</div><h4 id='method.all' class="method"><code id='all.v'>pub fn <a href='#method.all' class='fnname'>all</a>() -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#913-915' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allows all headers</p>
|
|
||||||
</div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<!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="API documentation for the Rust `AllowedMethods` type in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, AllowedMethods"><title>rocket_cors::AllowedMethods - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition AllowedMethods</p><div class="sidebar-elems"><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'AllowedMethods', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#893' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='index.html'>rocket_cors</a>::<wbr><a class="type" href=''>AllowedMethods</a></span></h1><pre class='rust typedef'>type AllowedMethods = <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/set/struct.HashSet.html" title="struct std::collections::hash::set::HashSet">HashSet</a><<a class="struct" href="../rocket_cors/struct.Method.html" title="struct rocket_cors::Method">Method</a>>;</pre><div class='docblock'><p>A list of allowed methods</p>
|
|
||||||
<p>The <a href="https://api.rocket.rs/rocket/http/enum.Method.html">list</a>
|
|
||||||
of methods is whatever is supported by Rocket.</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">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket_cors</span>::<span class="ident">AllowedMethods</span>;
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">allowed_methods</span>: <span class="ident">AllowedMethods</span> <span class="op">=</span> [<span class="string">"Get"</span>, <span class="string">"Post"</span>, <span class="string">"Delete"</span>]
|
|
||||||
.<span class="ident">iter</span>()
|
|
||||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> <span class="ident">FromStr</span>::<span class="ident">from_str</span>(<span class="ident">s</span>).<span class="ident">unwrap</span>())
|
|
||||||
.<span class="ident">collect</span>();</pre></div>
|
|
||||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
|
@ -1,80 +0,0 @@
|
||||||
<!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="API documentation for the Rust `AllowedOrigins` type in crate `rocket_cors`."><meta name="keywords" content="rust, rustlang, rust-lang, AllowedOrigins"><title>rocket_cors::AllowedOrigins - 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="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc type"><!--[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">☰</div><a href='../rocket_cors/index.html'><div class='logo-container'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Type Definition AllowedOrigins</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.all">all</a><a href="#method.some">some</a><a href="#method.some_exact">some_exact</a><a href="#method.some_null">some_null</a><a href="#method.some_regex">some_regex</a></div></div><p class='location'><a href='index.html'>rocket_cors</a></p><script>window.sidebarCurrent = {name: 'AllowedOrigins', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><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/rocket_cors/lib.rs.html#610' title='goto source code'>[src]</a></span><span class='in-band'>Type Definition <a href='index.html'>rocket_cors</a>::<wbr><a class="type" href=''>AllowedOrigins</a></span></h1><pre class='rust typedef'>type AllowedOrigins = <a class="enum" href="../rocket_cors/enum.AllOrSome.html" title="enum rocket_cors::AllOrSome">AllOrSome</a><<a class="struct" href="../rocket_cors/struct.Origins.html" title="struct rocket_cors::Origins">Origins</a>>;</pre><div class='docblock'><p>A list of allowed origins. Either Some origins are allowed, or all origins are allowed.</p>
|
|
||||||
<p>Exact matches are matched exactly with the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<p>Regular expressions are tested for matches against the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<h1 id="opaque-origins" class="section-header"><a href="#opaque-origins">Opaque Origins</a></h1>
|
|
||||||
<p>The <a href="https://html.spec.whatwg.org/multipage/origin.html">specification</a> defines an Opaque Origin
|
|
||||||
as one that cannot be recreated. You can refer to the source code for the <a href="https://docs.rs/url/2.0.0/url/struct.Url.html#method.origin" title="`url::Url::origin`"><code>url::Url::origin</code></a>
|
|
||||||
method to see how an Opaque Origin is determined. Examples of Opaque origins might include
|
|
||||||
schemes like <code>file://</code> or Browser specific schemes like <code>"moz-extension://</code> or
|
|
||||||
<code>chrome-extension://</code>.</p>
|
|
||||||
<p>Opaque Origins cannot be matched exactly. You must use Regex to match Opaque Origins. If you
|
|
||||||
attempt to create <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> from <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a>, you will get an error.</p>
|
|
||||||
<h1 id="warning-about-regex-expressions" class="section-header"><a href="#warning-about-regex-expressions">Warning about Regex expressions</a></h1>
|
|
||||||
<p>By default, regex expressions are
|
|
||||||
<a href="https://docs.rs/regex/1.1.2/regex/struct.RegexSet.html#method.is_match">unanchored</a>.</p>
|
|
||||||
<p>This means that if the regex does not start with <code>^</code> or <code>\A</code>, or end with <code>$</code> or <code>\z</code>,
|
|
||||||
then it is permitted to match anywhere in the text. You are encouraged to use the anchors when
|
|
||||||
crafting your Regex expressions.</p>
|
|
||||||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
|
||||||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket_cors</span>::<span class="ident">AllowedOrigins</span>;
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">exact</span> <span class="op">=</span> [<span class="string">"https://www.acme.com"</span>];
|
|
||||||
<span class="kw">let</span> <span class="ident">regex</span> <span class="op">=</span> [<span class="string">"^https://(.+).acme.com$"</span>];
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">all_origins</span> <span class="op">=</span> <span class="ident">AllowedOrigins</span>::<span class="ident">all</span>();
|
|
||||||
<span class="kw">let</span> <span class="ident">some_origins</span> <span class="op">=</span> <span class="ident">AllowedOrigins</span>::<span class="ident">some_exact</span>(<span class="kw-2">&</span><span class="ident">exact</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">null_origins</span> <span class="op">=</span> <span class="ident">AllowedOrigins</span>::<span class="ident">some_null</span>();
|
|
||||||
<span class="kw">let</span> <span class="ident">regex_origins</span> <span class="op">=</span> <span class="ident">AllowedOrigins</span>::<span class="ident">some_regex</span>(<span class="kw-2">&</span><span class="ident">regex</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">mixed_origins</span> <span class="op">=</span> <span class="ident">AllowedOrigins</span>::<span class="ident">some</span>(<span class="kw-2">&</span><span class="ident">exact</span>, <span class="kw-2">&</span><span class="ident">regex</span>);</pre></div>
|
|
||||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="type" href="../rocket_cors/type.AllowedOrigins.html" title="type rocket_cors::AllowedOrigins">AllowedOrigins</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/rocket_cors/lib.rs.html#612-704' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.some' class="method"><code id='some.v'>pub fn <a href='#method.some' class='fnname'>some</a><'a, 'b, S1: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>, S2: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(<br> exact: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [S1]</a>, <br> regex: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'b [S2]</a><br>) -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#642-648' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allows some origins, with a mix of exact matches or regex matches</p>
|
|
||||||
<p>Validation is not performed at this stage, but at a later stage.</p>
|
|
||||||
<p>Exact matches are matched exactly with the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<p>Regular expressions are tested for matches against the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<h1 id="opaque-origins-1" class="section-header"><a href="#opaque-origins-1">Opaque Origins</a></h1>
|
|
||||||
<p>The <a href="https://html.spec.whatwg.org/multipage/origin.html">specification</a> defines an Opaque Origin
|
|
||||||
as one that cannot be recreated. You can refer to the source code for the <a href="https://docs.rs/url/2.0.0/url/struct.Url.html#method.origin" title="`url::Url::origin`"><code>url::Url::origin</code></a>
|
|
||||||
method to see how an Opaque Origin is determined. Examples of Opaque origins might include
|
|
||||||
schemes like <code>file://</code> or Browser specific schemes like <code>"moz-extension://</code> or
|
|
||||||
<code>chrome-extension://</code>.</p>
|
|
||||||
<p>Opaque Origins cannot be matched exactly. You must use Regex to match Opaque Origins. If you
|
|
||||||
attempt to create <a href="../rocket_cors/struct.Cors.html" title="`Cors`"><code>Cors</code></a> from <a href="../rocket_cors/struct.CorsOptions.html" title="`CorsOptions`"><code>CorsOptions</code></a>, you will get an error.</p>
|
|
||||||
<h1 id="warning-about-regex-expressions-1" class="section-header"><a href="#warning-about-regex-expressions-1">Warning about Regex expressions</a></h1>
|
|
||||||
<p>By default, regex expressions are
|
|
||||||
<a href="https://docs.rs/regex/1.1.2/regex/struct.RegexSet.html#method.is_match">unanchored</a>.</p>
|
|
||||||
<p>This means that if the regex does not start with <code>^</code> or <code>\A</code>, or end with <code>$</code> or <code>\z</code>,
|
|
||||||
then it is permitted to match anywhere in the text. You are encouraged to use the anchors when
|
|
||||||
crafting your Regex expressions.</p>
|
|
||||||
</div><h4 id='method.some_exact' class="method"><code id='some_exact.v'>pub fn <a href='#method.some_exact' class='fnname'>some_exact</a><S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(exact: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[S]</a>) -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#663-668' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allows some <em>exact</em> origins</p>
|
|
||||||
<p>Validation is not performed at this stage, but at a later stage.</p>
|
|
||||||
<p>Exact matches are matched exactly with the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<h1 id="opaque-origins-2" class="section-header"><a href="#opaque-origins-2">Opaque Origins</a></h1>
|
|
||||||
<p>The <a href="https://html.spec.whatwg.org/multipage/origin.html">specification</a> defines an Opaque Origin
|
|
||||||
as one that cannot be recreated. You can refer to the source code for the <a href="https://docs.rs/url/2.0.0/url/struct.Url.html#method.origin" title="`url::Url::origin`"><code>url::Url::origin</code></a>
|
|
||||||
method to see how an Opaque Origin is determined. Examples of Opaque origins might include
|
|
||||||
schemes like <code>file://</code> or Browser specific schemes like <code>"moz-extension://</code> or
|
|
||||||
<code>chrome-extension://</code>.</p>
|
|
||||||
</div><h4 id='method.some_regex' class="method"><code id='some_regex.v'>pub fn <a href='#method.some_regex' class='fnname'>some_regex</a><S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>(regex: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[S]</a>) -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#685-690' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allow some regular expression origins</p>
|
|
||||||
<p>Validation is not performed at this stage, but at a later stage.</p>
|
|
||||||
<p>Regular expressions are tested for matches against the
|
|
||||||
<a href="https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin">ASCII Serialization</a>
|
|
||||||
of the origin.</p>
|
|
||||||
<h1 id="warning-about-regex-expressions-2" class="section-header"><a href="#warning-about-regex-expressions-2">Warning about Regex expressions</a></h1>
|
|
||||||
<p>By default, regex expressions are
|
|
||||||
<a href="https://docs.rs/regex/1.1.2/regex/struct.RegexSet.html#method.is_match">unanchored</a>.</p>
|
|
||||||
<p>This means that if the regex does not start with <code>^</code> or <code>\A</code>, or end with <code>$</code> or <code>\z</code>,
|
|
||||||
then it is permitted to match anywhere in the text. You are encouraged to use the anchors when
|
|
||||||
crafting your Regex expressions.</p>
|
|
||||||
</div><h4 id='method.some_null' class="method"><code id='some_null.v'>pub fn <a href='#method.some_null' class='fnname'>some_null</a>() -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#693-698' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allow some <code>null</code> origins</p>
|
|
||||||
</div><h4 id='method.all' class="method"><code id='all.v'>pub fn <a href='#method.all' class='fnname'>all</a>() -> Self</code><a class='srclink' href='../src/rocket_cors/lib.rs.html#701-703' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allows all origins</p>
|
|
||||||
</div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "rocket_cors";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
BIN
rust-logo.png
BIN
rust-logo.png
Binary file not shown.
Before Width: | Height: | Size: 5.6 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
.setting-line{padding:5px;position:relative;}.setting-line>div{max-width:calc(100% - 74px);display:inline-block;vertical-align:top;font-size:17px;padding-top:2px;}.setting-line>.title{font-size:19px;width:100%;max-width:none;border-bottom:1px solid;}.toggle{position:relative;display:inline-block;width:45px;height:27px;margin-right:20px;}.toggle input{display:none;}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.3s;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;background-color:white;-webkit-transition:.3s;transition:.3s;}input:checked+.slider{background-color:#2196F3;}input:focus+.slider{box-shadow:0 0 1px #2196F3;}input:checked+.slider:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;}
|
|
|
@ -1,2 +0,0 @@
|
||||||
<!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="Settings of Rustdoc"><meta name="keywords" content="rust, rustlang, rust-lang"><title>Rustdoc settings</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="./settings.css"><link rel="stylesheet" type="text/css" href="./dark.css"><link rel="stylesheet" type="text/css" href="./light.css" id="themeStyle"><script src="./storage.js"></script><noscript><link rel="stylesheet" href="./noscript.css"></noscript><link rel="shortcut icon" href="./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">☰</div><a href='./rocket_cors/index.html'><div class='logo-container'><img src='./rust-logo.png' alt='logo'></div></a><p class='location'>Settings</p><div class='sidebar-elems'></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="./brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="./theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="./settings.html"><img src="./wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Rustdoc settings</span></h1><div class='settings'><div class='setting-line'><div class='title'>Auto-hide item declarations</div><div class='sub-settings'><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-struct' checked><span class='slider'></span></label><div>Auto-hide structs declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-enum' ><span class='slider'></span></label><div>Auto-hide enums declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-union' checked><span class='slider'></span></label><div>Auto-hide unions declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-trait' checked><span class='slider'></span></label><div>Auto-hide traits declaration</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-macro' ><span class='slider'></span></label><div>Auto-hide macros declaration</div></div></div>
|
|
||||||
</div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-attributes' checked><span class='slider'></span></label><div>Auto-hide item attributes.</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-method-docs' ><span class='slider'></span></label><div>Auto-hide item methods' documentation</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='auto-hide-trait-implementations' checked><span class='slider'></span></label><div>Auto-hide trait implementations documentation</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='go-to-only-result' ><span class='slider'></span></label><div>Directly go to item in search if there is only one result</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='line-numbers' ><span class='slider'></span></label><div>Show line numbers on code examples</div></div><div class='setting-line'><label class='toggle'><input type='checkbox' id='disable-shortcuts' ><span class='slider'></span></label><div>Disable keyboard shortcuts</div></div></div><script src='./settings.js'></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "./";window.currentCrate = "rocket_cors";</script><script src="./aliases.js"></script><script src="./main.js"></script><script defer src="./search-index.js"></script></body></html>
|
|
|
@ -1 +0,0 @@
|
||||||
(function(){function changeSetting(settingName,isEnabled){updateLocalStorage('rustdoc-'+settingName,isEnabled)}function getSettingValue(settingName){return getCurrentValue('rustdoc-'+settingName)}function setEvents(){var elems=document.getElementsByClassName("slider");if(!elems||elems.length===0){return}for(var i=0;i<elems.length;++i){var toggle=elems[i].previousElementSibling;var settingId=toggle.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)}}}setEvents()})()
|
|
|
@ -1,3 +0,0 @@
|
||||||
var N = null;var sourcesIndex = {};
|
|
||||||
sourcesIndex["rocket_cors"] = {"name":"","files":["fairing.rs","headers.rs","lib.rs"]};
|
|
||||||
createSourceSidebar();
|
|
|
@ -1 +0,0 @@
|
||||||
function getCurrentFilePath(){var parts=window.location.pathname.split("/");var rootPathParts=window.rootPath.split("/");for(var i=0;i<rootPathParts.length;++i){if(rootPathParts[i]===".."){parts.pop()}}var file=window.location.pathname.substring(parts.join("/").length);if(file.startsWith("/")){file=file.substring(1)}return file.substring(0,file.length-5)}function createDirEntry(elem,parent,fullPath,currentFile,hasFoundFile){var name=document.createElement("div");name.className="name";fullPath+=elem["name"]+"/";name.onclick=function(){if(hasClass(this,"expand")){removeClass(this,"expand")}else{addClass(this,"expand")}};name.innerText=elem["name"];var children=document.createElement("div");children.className="children";var folders=document.createElement("div");folders.className="folders";if(elem.dirs){for(var i=0;i<elem.dirs.length;++i){if(createDirEntry(elem.dirs[i],folders,fullPath,currentFile,hasFoundFile)===true){addClass(name,"expand");hasFoundFile=true}}}children.appendChild(folders);var files=document.createElement("div");files.className="files";if(elem.files){for(i=0;i<elem.files.length;++i){var file=document.createElement("a");file.innerText=elem.files[i];file.href=window.rootPath+"src/"+fullPath+elem.files[i]+".html";if(hasFoundFile===false&¤tFile===fullPath+elem.files[i]){file.className="selected";addClass(name,"expand");hasFoundFile=true}files.appendChild(file)}}search.fullPath=fullPath;children.appendChild(files);parent.appendChild(name);parent.appendChild(children);return hasFoundFile===true&¤tFile.startsWith(fullPath)}function toggleSidebar(){var sidebar=document.getElementById("source-sidebar");var child=this.children[0].children[0];if(child.innerText===">"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<"}else{inner2.innerText=">";sidebarToggle.style.left="0"}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle}function createSourceSidebar(){if(window.rootPath.endsWith("/")===false){window.rootPath+="/"}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px"}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});main.insertBefore(sidebar,main.firstChild)}
|
|
|
@ -0,0 +1,205 @@
|
||||||
|
//! Fairing implementation
|
||||||
|
|
||||||
|
#[allow(unused_imports)]
|
||||||
|
use ::log::{error, info};
|
||||||
|
use rocket::http::{self, uri::Origin, Status};
|
||||||
|
use rocket::{self, error_, info_, outcome::Outcome, Request};
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
actual_request_response, origin, preflight_response, request_headers, validate, Cors, Error,
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Request Local State to store CORS validation results
|
||||||
|
enum CorsValidation {
|
||||||
|
Success,
|
||||||
|
Failure,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a `Handler` for Fairing error handling
|
||||||
|
#[derive(Clone)]
|
||||||
|
struct FairingErrorRoute {}
|
||||||
|
|
||||||
|
#[rocket::async_trait]
|
||||||
|
impl rocket::route::Handler for FairingErrorRoute {
|
||||||
|
async fn handle<'r>(
|
||||||
|
&self,
|
||||||
|
request: &'r Request<'_>,
|
||||||
|
_: rocket::Data,
|
||||||
|
) -> rocket::route::Outcome<'r> {
|
||||||
|
let status = request
|
||||||
|
.param::<u16>(0)
|
||||||
|
.unwrap_or(Ok(0))
|
||||||
|
.unwrap_or_else(|e| {
|
||||||
|
error_!("Fairing Error Handling Route error: {:?}", e);
|
||||||
|
500
|
||||||
|
});
|
||||||
|
let status = Status::from_code(status).unwrap_or(Status::InternalServerError);
|
||||||
|
Outcome::Failure(status)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a new `Route` for Fairing handling
|
||||||
|
fn fairing_route(rank: isize) -> rocket::Route {
|
||||||
|
rocket::Route::ranked(rank, http::Method::Get, "/<status>", FairingErrorRoute {})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Modifies a `Request` to route to Fairing error handler
|
||||||
|
fn route_to_fairing_error_handler(options: &Cors, status: u16, request: &mut Request<'_>) {
|
||||||
|
let origin = Origin::parse_owned(format!("{}/{}", options.fairing_route_base, status)).unwrap();
|
||||||
|
|
||||||
|
request.set_method(http::Method::Get);
|
||||||
|
request.set_uri(origin);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn on_response_wrapper(
|
||||||
|
options: &Cors,
|
||||||
|
request: &Request<'_>,
|
||||||
|
response: &mut rocket::Response<'_>,
|
||||||
|
) -> Result<(), Error> {
|
||||||
|
let origin = match origin(request)? {
|
||||||
|
None => {
|
||||||
|
// Not a CORS request
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
Some(origin) => origin,
|
||||||
|
};
|
||||||
|
|
||||||
|
let result = request.local_cache(|| unreachable!("This should not be executed so late"));
|
||||||
|
|
||||||
|
if let CorsValidation::Failure = *result {
|
||||||
|
// Nothing else for us to do
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let origin = origin.to_string();
|
||||||
|
let cors_response = if request.method() == http::Method::Options {
|
||||||
|
let headers = request_headers(request)?;
|
||||||
|
preflight_response(options, &origin, headers.as_ref())
|
||||||
|
} else {
|
||||||
|
actual_request_response(options, &origin)
|
||||||
|
};
|
||||||
|
|
||||||
|
cors_response.merge(response);
|
||||||
|
|
||||||
|
// If this was an OPTIONS request and no route can be found, we should turn this
|
||||||
|
// into a HTTP 204 with no content body.
|
||||||
|
// This allows the user to not have to specify an OPTIONS route for everything.
|
||||||
|
//
|
||||||
|
// TODO: Is there anyway we can make this smarter? Only modify status codes for
|
||||||
|
// requests where an actual route exist?
|
||||||
|
if request.method() == http::Method::Options && request.route().is_none() {
|
||||||
|
info_!(
|
||||||
|
"CORS Fairing: Turned missing route {} into an OPTIONS pre-flight request",
|
||||||
|
request
|
||||||
|
);
|
||||||
|
response.set_status(Status::NoContent);
|
||||||
|
let _ = response.body();
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::async_trait]
|
||||||
|
impl rocket::fairing::Fairing for Cors {
|
||||||
|
fn info(&self) -> rocket::fairing::Info {
|
||||||
|
rocket::fairing::Info {
|
||||||
|
name: "CORS",
|
||||||
|
kind: rocket::fairing::Kind::Ignite
|
||||||
|
| rocket::fairing::Kind::Request
|
||||||
|
| rocket::fairing::Kind::Response,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn on_ignite(&self, rocket: rocket::Rocket<rocket::Build>) -> rocket::fairing::Result {
|
||||||
|
Ok(rocket.mount(
|
||||||
|
&self.fairing_route_base,
|
||||||
|
vec![fairing_route(self.fairing_route_rank)],
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn on_request(&self, request: &mut Request<'_>, _: &mut rocket::Data) {
|
||||||
|
let result = match validate(self, request) {
|
||||||
|
Ok(_) => CorsValidation::Success,
|
||||||
|
Err(err) => {
|
||||||
|
error_!("CORS Error: {}", err);
|
||||||
|
let status = err.status();
|
||||||
|
route_to_fairing_error_handler(self, status.code, request);
|
||||||
|
CorsValidation::Failure
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let _ = request.local_cache(|| result);
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn on_response<'r>(&self, request: &'r Request<'_>, response: &mut rocket::Response<'r>) {
|
||||||
|
if let Err(err) = on_response_wrapper(self, request, response) {
|
||||||
|
error_!("Fairings on_response error: {}\nMost likely a bug", err);
|
||||||
|
response.set_status(Status::InternalServerError);
|
||||||
|
let _ = response.body();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use rocket::http::{Method, Status};
|
||||||
|
use rocket::local::blocking::Client;
|
||||||
|
use rocket::Rocket;
|
||||||
|
|
||||||
|
use crate::{AllowedHeaders, AllowedOrigins, Cors, CorsOptions};
|
||||||
|
|
||||||
|
const CORS_ROOT: &str = "/my_cors";
|
||||||
|
|
||||||
|
fn make_cors_options() -> Cors {
|
||||||
|
let allowed_origins = AllowedOrigins::some_exact(&["https://www.acme.com"]);
|
||||||
|
|
||||||
|
CorsOptions {
|
||||||
|
allowed_origins,
|
||||||
|
allowed_methods: vec![Method::Get].into_iter().map(From::from).collect(),
|
||||||
|
allowed_headers: AllowedHeaders::some(&["Authorization", "Accept"]),
|
||||||
|
allow_credentials: true,
|
||||||
|
fairing_route_base: CORS_ROOT.to_string(),
|
||||||
|
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
.to_cors()
|
||||||
|
.expect("Not to fail")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn rocket(fairing: Cors) -> Rocket<rocket::Build> {
|
||||||
|
Rocket::build().attach(fairing)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
fn FairingErrorRoute_returns_passed_in_status() {
|
||||||
|
let client = Client::tracked(rocket(make_cors_options())).expect("to not fail");
|
||||||
|
let request = client.get(format!("{}/403", CORS_ROOT));
|
||||||
|
let response = request.dispatch();
|
||||||
|
assert_eq!(Status::Forbidden, response.status());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
fn FairingErrorRoute_returns_500_for_unknown_status() {
|
||||||
|
let client = Client::tracked(rocket(make_cors_options())).expect("to not fail");
|
||||||
|
let request = client.get(format!("{}/999", CORS_ROOT));
|
||||||
|
let response = request.dispatch();
|
||||||
|
assert_eq!(Status::InternalServerError, response.status());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::async_test]
|
||||||
|
async fn error_route_is_mounted_on_ignite() {
|
||||||
|
let rocket = rocket(make_cors_options())
|
||||||
|
.ignite()
|
||||||
|
.await
|
||||||
|
.expect("to ignite");
|
||||||
|
|
||||||
|
let expected_uri = format!("{}/<status>", CORS_ROOT);
|
||||||
|
let error_route = rocket
|
||||||
|
.routes()
|
||||||
|
.find(|r| r.method == Method::Get && r.uri.to_string() == expected_uri);
|
||||||
|
assert!(error_route.is_some());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rest of the things can only be tested in integration tests
|
||||||
|
}
|
|
@ -0,0 +1,411 @@
|
||||||
|
//! CORS specific Request Headers
|
||||||
|
|
||||||
|
use std::collections::HashSet;
|
||||||
|
use std::fmt;
|
||||||
|
use std::ops::Deref;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
use rocket::http::Status;
|
||||||
|
use rocket::request::{self, FromRequest};
|
||||||
|
use rocket::{self, outcome::Outcome};
|
||||||
|
#[cfg(feature = "serialization")]
|
||||||
|
use serde_derive::{Deserialize, Serialize};
|
||||||
|
use unicase::UniCase;
|
||||||
|
|
||||||
|
/// A case insensitive header name
|
||||||
|
#[derive(Eq, PartialEq, Clone, Debug, Hash)]
|
||||||
|
#[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
|
||||||
|
pub struct HeaderFieldName(
|
||||||
|
#[cfg_attr(feature = "serialization", serde(with = "unicase_serde::unicase"))] UniCase<String>,
|
||||||
|
);
|
||||||
|
|
||||||
|
impl Deref for HeaderFieldName {
|
||||||
|
type Target = String;
|
||||||
|
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
self.0.deref()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl fmt::Display for HeaderFieldName {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.0.fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> From<&'a str> for HeaderFieldName {
|
||||||
|
fn from(s: &'a str) -> Self {
|
||||||
|
HeaderFieldName(From::from(s))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> From<String> for HeaderFieldName {
|
||||||
|
fn from(s: String) -> Self {
|
||||||
|
HeaderFieldName(From::from(s))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromStr for HeaderFieldName {
|
||||||
|
type Err = <String as FromStr>::Err;
|
||||||
|
|
||||||
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
|
Ok(HeaderFieldName(FromStr::from_str(s)?))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A set of case insensitive header names
|
||||||
|
pub type HeaderFieldNamesSet = HashSet<HeaderFieldName>;
|
||||||
|
|
||||||
|
/// The `Origin` request header used in CORS
|
||||||
|
///
|
||||||
|
/// You can use this as a rocket [Request Guard](https://rocket.rs/guide/requests/#request-guards)
|
||||||
|
/// to ensure that `Origin` is passed in correctly.
|
||||||
|
///
|
||||||
|
/// Reference: [Mozilla](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin)
|
||||||
|
#[derive(Eq, PartialEq, Clone, Hash, Debug)]
|
||||||
|
pub enum Origin {
|
||||||
|
/// A `null` Origin
|
||||||
|
Null,
|
||||||
|
/// A well-formed origin that was parsed by [`url::Url::origin`]
|
||||||
|
Parsed(url::Origin),
|
||||||
|
/// An unknown "opaque" origin that could not be parsed
|
||||||
|
Opaque(String),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Origin {
|
||||||
|
/// Perform an
|
||||||
|
/// [ASCII serialization](https://html.spec.whatwg.org/multipage/#ascii-serialisation-of-an-origin)
|
||||||
|
/// of this origin.
|
||||||
|
pub fn ascii_serialization(&self) -> String {
|
||||||
|
self.to_string()
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns whether the origin was parsed as non-opaque
|
||||||
|
pub fn is_tuple(&self) -> bool {
|
||||||
|
match self {
|
||||||
|
Origin::Null => false,
|
||||||
|
Origin::Parsed(ref parsed) => parsed.is_tuple(),
|
||||||
|
Origin::Opaque(_) => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Derives an instance of `Self` from the incoming request metadata.
|
||||||
|
///
|
||||||
|
/// If the derivation is successful, an outcome of `Success` is returned. If
|
||||||
|
/// the derivation fails in an unrecoverable fashion, `Failure` is returned.
|
||||||
|
/// `Forward` is returned to indicate that the request should be forwarded
|
||||||
|
/// to other matching routes, if any.
|
||||||
|
pub fn from_request_sync(
|
||||||
|
request: &'_ rocket::Request<'_>,
|
||||||
|
) -> request::Outcome<Self, crate::Error> {
|
||||||
|
match request.headers().get_one("Origin") {
|
||||||
|
Some(origin) => match Self::from_str(origin) {
|
||||||
|
Ok(origin) => Outcome::Success(origin),
|
||||||
|
Err(e) => Outcome::Failure((Status::BadRequest, e)),
|
||||||
|
},
|
||||||
|
None => Outcome::Forward(()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromStr for Origin {
|
||||||
|
type Err = crate::Error;
|
||||||
|
|
||||||
|
fn from_str(input: &str) -> Result<Self, Self::Err> {
|
||||||
|
if input.to_lowercase() == "null" {
|
||||||
|
Ok(Origin::Null)
|
||||||
|
} else {
|
||||||
|
match crate::to_origin(input)? {
|
||||||
|
url::Origin::Opaque(_) => Ok(Origin::Opaque(input.to_string())),
|
||||||
|
parsed @ url::Origin::Tuple(..) => Ok(Origin::Parsed(parsed)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl fmt::Display for Origin {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
match self {
|
||||||
|
Origin::Null => write!(f, "null"),
|
||||||
|
Origin::Parsed(ref parsed) => write!(f, "{}", parsed.ascii_serialization()),
|
||||||
|
Origin::Opaque(ref opaque) => write!(f, "{}", opaque),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::async_trait]
|
||||||
|
impl<'r> FromRequest<'r> for Origin {
|
||||||
|
type Error = crate::Error;
|
||||||
|
|
||||||
|
async fn from_request(
|
||||||
|
request: &'r rocket::Request<'_>,
|
||||||
|
) -> request::Outcome<Self, crate::Error> {
|
||||||
|
Origin::from_request_sync(request)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The `Access-Control-Request-Method` request header
|
||||||
|
///
|
||||||
|
/// You can use this as a rocket [Request Guard](https://rocket.rs/guide/requests/#request-guards)
|
||||||
|
/// to ensure that the header is passed in correctly.
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct AccessControlRequestMethod(pub crate::Method);
|
||||||
|
|
||||||
|
impl AccessControlRequestMethod {
|
||||||
|
/// Derives an instance of `Self` from the incoming request metadata.
|
||||||
|
///
|
||||||
|
/// If the derivation is successful, an outcome of `Success` is returned. If
|
||||||
|
/// the derivation fails in an unrecoverable fashion, `Failure` is returned.
|
||||||
|
/// `Forward` is returned to indicate that the request should be forwarded
|
||||||
|
/// to other matching routes, if any.
|
||||||
|
pub fn from_request_sync(
|
||||||
|
request: &'_ rocket::Request<'_>,
|
||||||
|
) -> request::Outcome<Self, crate::Error> {
|
||||||
|
match request.headers().get_one("Access-Control-Request-Method") {
|
||||||
|
Some(request_method) => match Self::from_str(request_method) {
|
||||||
|
Ok(request_method) => Outcome::Success(request_method),
|
||||||
|
Err(_) => Outcome::Failure((Status::BadRequest, crate::Error::BadRequestMethod)),
|
||||||
|
},
|
||||||
|
None => Outcome::Forward(()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromStr for AccessControlRequestMethod {
|
||||||
|
type Err = ();
|
||||||
|
|
||||||
|
fn from_str(method: &str) -> Result<Self, Self::Err> {
|
||||||
|
Ok(AccessControlRequestMethod(crate::Method::from_str(method)?))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::async_trait]
|
||||||
|
impl<'r> FromRequest<'r> for AccessControlRequestMethod {
|
||||||
|
type Error = crate::Error;
|
||||||
|
|
||||||
|
async fn from_request(
|
||||||
|
request: &'r rocket::Request<'_>,
|
||||||
|
) -> request::Outcome<Self, crate::Error> {
|
||||||
|
AccessControlRequestMethod::from_request_sync(request)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The `Access-Control-Request-Headers` request header
|
||||||
|
///
|
||||||
|
/// You can use this as a rocket [Request Guard](https://rocket.rs/guide/requests/#request-guards)
|
||||||
|
/// to ensure that the header is passed in correctly.
|
||||||
|
#[derive(Eq, PartialEq, Debug)]
|
||||||
|
pub struct AccessControlRequestHeaders(pub HeaderFieldNamesSet);
|
||||||
|
|
||||||
|
impl AccessControlRequestHeaders {
|
||||||
|
/// Derives an instance of `Self` from the incoming request metadata.
|
||||||
|
///
|
||||||
|
/// If the derivation is successful, an outcome of `Success` is returned. If
|
||||||
|
/// the derivation fails in an unrecoverable fashion, `Failure` is returned.
|
||||||
|
/// `Forward` is returned to indicate that the request should be forwarded
|
||||||
|
/// to other matching routes, if any.
|
||||||
|
pub fn from_request_sync(
|
||||||
|
request: &'_ rocket::Request<'_>,
|
||||||
|
) -> request::Outcome<Self, crate::Error> {
|
||||||
|
match request.headers().get_one("Access-Control-Request-Headers") {
|
||||||
|
Some(request_headers) => match Self::from_str(request_headers) {
|
||||||
|
Ok(request_headers) => Outcome::Success(request_headers),
|
||||||
|
Err(()) => {
|
||||||
|
unreachable!("`AccessControlRequestHeaders::from_str` should never fail")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
None => Outcome::Forward(()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Will never fail
|
||||||
|
impl FromStr for AccessControlRequestHeaders {
|
||||||
|
type Err = ();
|
||||||
|
|
||||||
|
/// Will never fail
|
||||||
|
fn from_str(headers: &str) -> Result<Self, Self::Err> {
|
||||||
|
if headers.trim().is_empty() {
|
||||||
|
return Ok(AccessControlRequestHeaders(HashSet::new()));
|
||||||
|
}
|
||||||
|
|
||||||
|
let set: HeaderFieldNamesSet = headers
|
||||||
|
.split(',')
|
||||||
|
.map(|header| From::from(header.trim().to_string()))
|
||||||
|
.collect();
|
||||||
|
Ok(AccessControlRequestHeaders(set))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rocket::async_trait]
|
||||||
|
impl<'r> FromRequest<'r> for AccessControlRequestHeaders {
|
||||||
|
type Error = crate::Error;
|
||||||
|
|
||||||
|
async fn from_request(
|
||||||
|
request: &'r rocket::Request<'_>,
|
||||||
|
) -> request::Outcome<Self, crate::Error> {
|
||||||
|
AccessControlRequestHeaders::from_request_sync(request)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
use rocket::http::hyper;
|
||||||
|
use rocket::http::Header;
|
||||||
|
use rocket::local::blocking::Client;
|
||||||
|
|
||||||
|
static ORIGIN: hyper::HeaderName = hyper::header::ORIGIN;
|
||||||
|
static ACCESS_CONTROL_REQUEST_METHOD: hyper::HeaderName =
|
||||||
|
hyper::header::ACCESS_CONTROL_REQUEST_METHOD;
|
||||||
|
static ACCESS_CONTROL_REQUEST_HEADERS: hyper::HeaderName =
|
||||||
|
hyper::header::ACCESS_CONTROL_REQUEST_HEADERS;
|
||||||
|
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
/// Make a client with no routes for unit testing
|
||||||
|
fn make_client() -> Client {
|
||||||
|
let rocket = rocket::build();
|
||||||
|
Client::tracked(rocket).expect("valid rocket instance")
|
||||||
|
}
|
||||||
|
|
||||||
|
// `Origin::from_str` tests
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn origin_is_parsed_properly() {
|
||||||
|
let url = "https://foo.bar.xyz";
|
||||||
|
let parsed = not_err!(Origin::from_str(url));
|
||||||
|
assert_eq!(parsed.ascii_serialization(), url);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn origin_parsing_strips_paths() {
|
||||||
|
// this should never really be sent by a compliant user agent
|
||||||
|
let url = "https://foo.bar.xyz/path/somewhere";
|
||||||
|
let parsed = not_err!(Origin::from_str(url));
|
||||||
|
let expected = "https://foo.bar.xyz";
|
||||||
|
assert_eq!(parsed.ascii_serialization(), expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[should_panic(expected = "BadOrigin")]
|
||||||
|
fn origin_parsing_disallows_invalid_origins() {
|
||||||
|
let url = "invalid_url";
|
||||||
|
let _ = Origin::from_str(url).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn origin_parses_opaque_origins() {
|
||||||
|
let url = "blob://foobar";
|
||||||
|
let parsed = not_err!(Origin::from_str(url));
|
||||||
|
|
||||||
|
assert!(!parsed.is_tuple());
|
||||||
|
}
|
||||||
|
|
||||||
|
// The following tests check that CORS Request headers are parsed correctly
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn origin_header_conversion() {
|
||||||
|
let url = "https://foo.bar.xyz";
|
||||||
|
let parsed = not_err!(Origin::from_str(url));
|
||||||
|
assert_eq!(parsed.ascii_serialization(), url);
|
||||||
|
|
||||||
|
let url = "https://foo.bar.xyz:1234";
|
||||||
|
let parsed = not_err!(Origin::from_str(url));
|
||||||
|
assert_eq!(parsed.ascii_serialization(), url);
|
||||||
|
|
||||||
|
// this should never really be sent by a compliant user agent
|
||||||
|
let url = "https://foo.bar.xyz/path/somewhere";
|
||||||
|
let parsed = not_err!(Origin::from_str(url));
|
||||||
|
let expected = "https://foo.bar.xyz";
|
||||||
|
assert_eq!(parsed.ascii_serialization(), expected);
|
||||||
|
|
||||||
|
let url = "invalid_url";
|
||||||
|
let _ = is_err!(Origin::from_str(url));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn origin_header_parsing() {
|
||||||
|
let client = make_client();
|
||||||
|
let mut request = client.get("/");
|
||||||
|
|
||||||
|
let origin = Header::new(ORIGIN.as_str(), "https://www.example.com");
|
||||||
|
request.add_header(origin);
|
||||||
|
|
||||||
|
let outcome = Origin::from_request_sync(request.inner());
|
||||||
|
let parsed_header = assert_matches!(outcome, Outcome::Success(s), s);
|
||||||
|
assert_eq!(
|
||||||
|
"https://www.example.com",
|
||||||
|
parsed_header.ascii_serialization()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn request_method_conversion() {
|
||||||
|
let method = "POST";
|
||||||
|
let parsed_method = not_err!(AccessControlRequestMethod::from_str(method));
|
||||||
|
assert_matches!(
|
||||||
|
parsed_method,
|
||||||
|
AccessControlRequestMethod(crate::Method(rocket::http::Method::Post))
|
||||||
|
);
|
||||||
|
|
||||||
|
let method = "options";
|
||||||
|
let parsed_method = not_err!(AccessControlRequestMethod::from_str(method));
|
||||||
|
assert_matches!(
|
||||||
|
parsed_method,
|
||||||
|
AccessControlRequestMethod(crate::Method(rocket::http::Method::Options))
|
||||||
|
);
|
||||||
|
|
||||||
|
let method = "INVALID";
|
||||||
|
is_err!(AccessControlRequestMethod::from_str(method));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn request_method_parsing() {
|
||||||
|
let client = make_client();
|
||||||
|
let mut request = client.get("/");
|
||||||
|
let method = Header::new(
|
||||||
|
ACCESS_CONTROL_REQUEST_METHOD.as_str(),
|
||||||
|
hyper::Method::GET.as_str(),
|
||||||
|
);
|
||||||
|
request.add_header(method);
|
||||||
|
let outcome = AccessControlRequestMethod::from_request_sync(request.inner());
|
||||||
|
|
||||||
|
let parsed_header = assert_matches!(outcome, Outcome::Success(s), s);
|
||||||
|
let AccessControlRequestMethod(parsed_method) = parsed_header;
|
||||||
|
assert_eq!("GET", parsed_method.as_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn request_headers_conversion() {
|
||||||
|
let headers = ["foo", "bar", "baz"];
|
||||||
|
let parsed_headers = not_err!(AccessControlRequestHeaders::from_str(&headers.join(", ")));
|
||||||
|
let expected_headers: HeaderFieldNamesSet =
|
||||||
|
headers.iter().map(|s| (*s).to_string().into()).collect();
|
||||||
|
let AccessControlRequestHeaders(actual_headers) = parsed_headers;
|
||||||
|
assert_eq!(actual_headers, expected_headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn request_headers_parsing() {
|
||||||
|
let client = make_client();
|
||||||
|
let mut request = client.get("/");
|
||||||
|
let headers = Header::new(
|
||||||
|
ACCESS_CONTROL_REQUEST_HEADERS.as_str(),
|
||||||
|
"accept-language, date",
|
||||||
|
);
|
||||||
|
request.add_header(headers);
|
||||||
|
let outcome = AccessControlRequestHeaders::from_request_sync(request.inner());
|
||||||
|
|
||||||
|
let parsed_header = assert_matches!(outcome, Outcome::Success(s), s);
|
||||||
|
let AccessControlRequestHeaders(parsed_headers) = parsed_header;
|
||||||
|
let mut parsed_headers: Vec<String> =
|
||||||
|
parsed_headers.iter().map(ToString::to_string).collect();
|
||||||
|
parsed_headers.sort();
|
||||||
|
assert_eq!(
|
||||||
|
vec!["accept-language".to_string(), "date".to_string()],
|
||||||
|
parsed_headers
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,385 +0,0 @@
|
||||||
<!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="Source to the Rust file `src/fairing.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>fairing.rs.html -- source</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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[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">☰</div><a href='../../rocket_cors/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
|
|
||||||
<span id="2"> 2</span>
|
|
||||||
<span id="3"> 3</span>
|
|
||||||
<span id="4"> 4</span>
|
|
||||||
<span id="5"> 5</span>
|
|
||||||
<span id="6"> 6</span>
|
|
||||||
<span id="7"> 7</span>
|
|
||||||
<span id="8"> 8</span>
|
|
||||||
<span id="9"> 9</span>
|
|
||||||
<span id="10"> 10</span>
|
|
||||||
<span id="11"> 11</span>
|
|
||||||
<span id="12"> 12</span>
|
|
||||||
<span id="13"> 13</span>
|
|
||||||
<span id="14"> 14</span>
|
|
||||||
<span id="15"> 15</span>
|
|
||||||
<span id="16"> 16</span>
|
|
||||||
<span id="17"> 17</span>
|
|
||||||
<span id="18"> 18</span>
|
|
||||||
<span id="19"> 19</span>
|
|
||||||
<span id="20"> 20</span>
|
|
||||||
<span id="21"> 21</span>
|
|
||||||
<span id="22"> 22</span>
|
|
||||||
<span id="23"> 23</span>
|
|
||||||
<span id="24"> 24</span>
|
|
||||||
<span id="25"> 25</span>
|
|
||||||
<span id="26"> 26</span>
|
|
||||||
<span id="27"> 27</span>
|
|
||||||
<span id="28"> 28</span>
|
|
||||||
<span id="29"> 29</span>
|
|
||||||
<span id="30"> 30</span>
|
|
||||||
<span id="31"> 31</span>
|
|
||||||
<span id="32"> 32</span>
|
|
||||||
<span id="33"> 33</span>
|
|
||||||
<span id="34"> 34</span>
|
|
||||||
<span id="35"> 35</span>
|
|
||||||
<span id="36"> 36</span>
|
|
||||||
<span id="37"> 37</span>
|
|
||||||
<span id="38"> 38</span>
|
|
||||||
<span id="39"> 39</span>
|
|
||||||
<span id="40"> 40</span>
|
|
||||||
<span id="41"> 41</span>
|
|
||||||
<span id="42"> 42</span>
|
|
||||||
<span id="43"> 43</span>
|
|
||||||
<span id="44"> 44</span>
|
|
||||||
<span id="45"> 45</span>
|
|
||||||
<span id="46"> 46</span>
|
|
||||||
<span id="47"> 47</span>
|
|
||||||
<span id="48"> 48</span>
|
|
||||||
<span id="49"> 49</span>
|
|
||||||
<span id="50"> 50</span>
|
|
||||||
<span id="51"> 51</span>
|
|
||||||
<span id="52"> 52</span>
|
|
||||||
<span id="53"> 53</span>
|
|
||||||
<span id="54"> 54</span>
|
|
||||||
<span id="55"> 55</span>
|
|
||||||
<span id="56"> 56</span>
|
|
||||||
<span id="57"> 57</span>
|
|
||||||
<span id="58"> 58</span>
|
|
||||||
<span id="59"> 59</span>
|
|
||||||
<span id="60"> 60</span>
|
|
||||||
<span id="61"> 61</span>
|
|
||||||
<span id="62"> 62</span>
|
|
||||||
<span id="63"> 63</span>
|
|
||||||
<span id="64"> 64</span>
|
|
||||||
<span id="65"> 65</span>
|
|
||||||
<span id="66"> 66</span>
|
|
||||||
<span id="67"> 67</span>
|
|
||||||
<span id="68"> 68</span>
|
|
||||||
<span id="69"> 69</span>
|
|
||||||
<span id="70"> 70</span>
|
|
||||||
<span id="71"> 71</span>
|
|
||||||
<span id="72"> 72</span>
|
|
||||||
<span id="73"> 73</span>
|
|
||||||
<span id="74"> 74</span>
|
|
||||||
<span id="75"> 75</span>
|
|
||||||
<span id="76"> 76</span>
|
|
||||||
<span id="77"> 77</span>
|
|
||||||
<span id="78"> 78</span>
|
|
||||||
<span id="79"> 79</span>
|
|
||||||
<span id="80"> 80</span>
|
|
||||||
<span id="81"> 81</span>
|
|
||||||
<span id="82"> 82</span>
|
|
||||||
<span id="83"> 83</span>
|
|
||||||
<span id="84"> 84</span>
|
|
||||||
<span id="85"> 85</span>
|
|
||||||
<span id="86"> 86</span>
|
|
||||||
<span id="87"> 87</span>
|
|
||||||
<span id="88"> 88</span>
|
|
||||||
<span id="89"> 89</span>
|
|
||||||
<span id="90"> 90</span>
|
|
||||||
<span id="91"> 91</span>
|
|
||||||
<span id="92"> 92</span>
|
|
||||||
<span id="93"> 93</span>
|
|
||||||
<span id="94"> 94</span>
|
|
||||||
<span id="95"> 95</span>
|
|
||||||
<span id="96"> 96</span>
|
|
||||||
<span id="97"> 97</span>
|
|
||||||
<span id="98"> 98</span>
|
|
||||||
<span id="99"> 99</span>
|
|
||||||
<span id="100">100</span>
|
|
||||||
<span id="101">101</span>
|
|
||||||
<span id="102">102</span>
|
|
||||||
<span id="103">103</span>
|
|
||||||
<span id="104">104</span>
|
|
||||||
<span id="105">105</span>
|
|
||||||
<span id="106">106</span>
|
|
||||||
<span id="107">107</span>
|
|
||||||
<span id="108">108</span>
|
|
||||||
<span id="109">109</span>
|
|
||||||
<span id="110">110</span>
|
|
||||||
<span id="111">111</span>
|
|
||||||
<span id="112">112</span>
|
|
||||||
<span id="113">113</span>
|
|
||||||
<span id="114">114</span>
|
|
||||||
<span id="115">115</span>
|
|
||||||
<span id="116">116</span>
|
|
||||||
<span id="117">117</span>
|
|
||||||
<span id="118">118</span>
|
|
||||||
<span id="119">119</span>
|
|
||||||
<span id="120">120</span>
|
|
||||||
<span id="121">121</span>
|
|
||||||
<span id="122">122</span>
|
|
||||||
<span id="123">123</span>
|
|
||||||
<span id="124">124</span>
|
|
||||||
<span id="125">125</span>
|
|
||||||
<span id="126">126</span>
|
|
||||||
<span id="127">127</span>
|
|
||||||
<span id="128">128</span>
|
|
||||||
<span id="129">129</span>
|
|
||||||
<span id="130">130</span>
|
|
||||||
<span id="131">131</span>
|
|
||||||
<span id="132">132</span>
|
|
||||||
<span id="133">133</span>
|
|
||||||
<span id="134">134</span>
|
|
||||||
<span id="135">135</span>
|
|
||||||
<span id="136">136</span>
|
|
||||||
<span id="137">137</span>
|
|
||||||
<span id="138">138</span>
|
|
||||||
<span id="139">139</span>
|
|
||||||
<span id="140">140</span>
|
|
||||||
<span id="141">141</span>
|
|
||||||
<span id="142">142</span>
|
|
||||||
<span id="143">143</span>
|
|
||||||
<span id="144">144</span>
|
|
||||||
<span id="145">145</span>
|
|
||||||
<span id="146">146</span>
|
|
||||||
<span id="147">147</span>
|
|
||||||
<span id="148">148</span>
|
|
||||||
<span id="149">149</span>
|
|
||||||
<span id="150">150</span>
|
|
||||||
<span id="151">151</span>
|
|
||||||
<span id="152">152</span>
|
|
||||||
<span id="153">153</span>
|
|
||||||
<span id="154">154</span>
|
|
||||||
<span id="155">155</span>
|
|
||||||
<span id="156">156</span>
|
|
||||||
<span id="157">157</span>
|
|
||||||
<span id="158">158</span>
|
|
||||||
<span id="159">159</span>
|
|
||||||
<span id="160">160</span>
|
|
||||||
<span id="161">161</span>
|
|
||||||
<span id="162">162</span>
|
|
||||||
<span id="163">163</span>
|
|
||||||
<span id="164">164</span>
|
|
||||||
<span id="165">165</span>
|
|
||||||
<span id="166">166</span>
|
|
||||||
<span id="167">167</span>
|
|
||||||
<span id="168">168</span>
|
|
||||||
<span id="169">169</span>
|
|
||||||
<span id="170">170</span>
|
|
||||||
<span id="171">171</span>
|
|
||||||
<span id="172">172</span>
|
|
||||||
<span id="173">173</span>
|
|
||||||
<span id="174">174</span>
|
|
||||||
<span id="175">175</span>
|
|
||||||
<span id="176">176</span>
|
|
||||||
<span id="177">177</span>
|
|
||||||
<span id="178">178</span>
|
|
||||||
<span id="179">179</span>
|
|
||||||
<span id="180">180</span>
|
|
||||||
<span id="181">181</span>
|
|
||||||
<span id="182">182</span>
|
|
||||||
<span id="183">183</span>
|
|
||||||
<span id="184">184</span>
|
|
||||||
<span id="185">185</span>
|
|
||||||
<span id="186">186</span>
|
|
||||||
<span id="187">187</span>
|
|
||||||
<span id="188">188</span>
|
|
||||||
<span id="189">189</span>
|
|
||||||
<span id="190">190</span>
|
|
||||||
<span id="191">191</span>
|
|
||||||
</pre><div class="example-wrap"><pre class="rust ">
|
|
||||||
<span class="doccomment">//! Fairing implementation</span>
|
|
||||||
|
|
||||||
<span class="kw">use</span> ::<span class="ident">log</span>::{<span class="ident">error</span>, <span class="ident">info</span>, <span class="ident">log</span>};
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::<span class="ident">http</span>::{<span class="self">self</span>, <span class="ident">uri</span>::<span class="ident">Origin</span>, <span class="ident">Status</span>};
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::{<span class="self">self</span>, <span class="ident">error_</span>, <span class="ident">info_</span>, <span class="ident">log_</span>, <span class="ident">Outcome</span>, <span class="ident">Request</span>};
|
|
||||||
|
|
||||||
<span class="kw">use</span> <span class="kw">crate</span>::{
|
|
||||||
<span class="ident">actual_request_response</span>, <span class="ident">origin</span>, <span class="ident">preflight_response</span>, <span class="ident">request_headers</span>, <span class="ident">validate</span>, <span class="ident">Cors</span>, <span class="ident">Error</span>,
|
|
||||||
};
|
|
||||||
|
|
||||||
<span class="doccomment">/// Request Local State to store CORS validation results</span>
|
|
||||||
<span class="kw">enum</span> <span class="ident">CorsValidation</span> {
|
|
||||||
<span class="ident">Success</span>,
|
|
||||||
<span class="ident">Failure</span>,
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="doccomment">/// Route for Fairing error handling</span>
|
|
||||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn</span> <span class="ident">fairing_error_route</span><span class="op"><</span><span class="lifetime">'r</span><span class="op">></span>(
|
|
||||||
<span class="ident">request</span>: <span class="kw-2">&</span><span class="lifetime">'r</span> <span class="ident">Request</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>,
|
|
||||||
<span class="kw">_</span>: <span class="ident">rocket</span>::<span class="ident">Data</span>,
|
|
||||||
) <span class="op">-</span><span class="op">></span> <span class="ident">rocket</span>::<span class="ident">handler</span>::<span class="ident">Outcome</span><span class="op"><</span><span class="lifetime">'r</span><span class="op">></span> {
|
|
||||||
<span class="kw">let</span> <span class="ident">status</span> <span class="op">=</span> <span class="ident">request</span>
|
|
||||||
.<span class="ident">get_param</span>::<span class="op"><</span><span class="ident">u16</span><span class="op">></span>(<span class="number">0</span>)
|
|
||||||
.<span class="ident">unwrap_or</span>(<span class="prelude-val">Ok</span>(<span class="number">0</span>))
|
|
||||||
.<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="ident">e</span><span class="op">|</span> {
|
|
||||||
<span class="macro">error_</span><span class="macro">!</span>(<span class="string">"Fairing Error Handling Route error: {:?}"</span>, <span class="ident">e</span>);
|
|
||||||
<span class="number">500</span>
|
|
||||||
});
|
|
||||||
<span class="kw">let</span> <span class="ident">status</span> <span class="op">=</span> <span class="ident">Status</span>::<span class="ident">from_code</span>(<span class="ident">status</span>).<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="op">|</span> <span class="ident">Status</span>::<span class="ident">InternalServerError</span>);
|
|
||||||
<span class="ident">Outcome</span>::<span class="ident">Failure</span>(<span class="ident">status</span>)
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="doccomment">/// Create a new `Route` for Fairing handling</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">fairing_route</span>(<span class="ident">rank</span>: <span class="ident">isize</span>) <span class="op">-</span><span class="op">></span> <span class="ident">rocket</span>::<span class="ident">Route</span> {
|
|
||||||
<span class="ident">rocket</span>::<span class="ident">Route</span>::<span class="ident">ranked</span>(<span class="ident">rank</span>, <span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">Get</span>, <span class="string">"/<status>"</span>, <span class="ident">fairing_error_route</span>)
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="doccomment">/// Modifies a `Request` to route to Fairing error handler</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">route_to_fairing_error_handler</span>(<span class="ident">options</span>: <span class="kw-2">&</span><span class="ident">Cors</span>, <span class="ident">status</span>: <span class="ident">u16</span>, <span class="ident">request</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Request</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) {
|
|
||||||
<span class="kw">let</span> <span class="ident">origin</span> <span class="op">=</span> <span class="ident">Origin</span>::<span class="ident">parse_owned</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/{}"</span>, <span class="ident">options</span>.<span class="ident">fairing_route_base</span>, <span class="ident">status</span>)).<span class="ident">unwrap</span>();
|
|
||||||
|
|
||||||
<span class="ident">request</span>.<span class="ident">set_method</span>(<span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">Get</span>);
|
|
||||||
<span class="ident">request</span>.<span class="ident">set_uri</span>(<span class="ident">origin</span>);
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">on_response_wrapper</span>(
|
|
||||||
<span class="ident">options</span>: <span class="kw-2">&</span><span class="ident">Cors</span>,
|
|
||||||
<span class="ident">request</span>: <span class="kw-2">&</span><span class="ident">Request</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>,
|
|
||||||
<span class="ident">response</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rocket</span>::<span class="ident">Response</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>,
|
|
||||||
) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">Error</span><span class="op">></span> {
|
|
||||||
<span class="kw">let</span> <span class="ident">origin</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">origin</span>(<span class="ident">request</span>)<span class="question-mark">?</span> {
|
|
||||||
<span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> {
|
|
||||||
<span class="comment">// Not a CORS request</span>
|
|
||||||
<span class="kw">return</span> <span class="prelude-val">Ok</span>(());
|
|
||||||
}
|
|
||||||
<span class="prelude-val">Some</span>(<span class="ident">origin</span>) <span class="op">=</span><span class="op">></span> <span class="ident">origin</span>,
|
|
||||||
};
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">request</span>.<span class="ident">local_cache</span>(<span class="op">|</span><span class="op">|</span> <span class="macro">unreachable</span><span class="macro">!</span>(<span class="string">"This should not be executed so late"</span>));
|
|
||||||
|
|
||||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">CorsValidation</span>::<span class="ident">Failure</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">result</span> {
|
|
||||||
<span class="comment">// Nothing else for us to do</span>
|
|
||||||
<span class="kw">return</span> <span class="prelude-val">Ok</span>(());
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">origin</span> <span class="op">=</span> <span class="ident">origin</span>.<span class="ident">to_string</span>();
|
|
||||||
<span class="kw">let</span> <span class="ident">cors_response</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">request</span>.<span class="ident">method</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">Options</span> {
|
|
||||||
<span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> <span class="ident">request_headers</span>(<span class="ident">request</span>)<span class="question-mark">?</span>;
|
|
||||||
<span class="ident">preflight_response</span>(<span class="ident">options</span>, <span class="kw-2">&</span><span class="ident">origin</span>, <span class="ident">headers</span>.<span class="ident">as_ref</span>())
|
|
||||||
} <span class="kw">else</span> {
|
|
||||||
<span class="ident">actual_request_response</span>(<span class="ident">options</span>, <span class="kw-2">&</span><span class="ident">origin</span>)
|
|
||||||
};
|
|
||||||
|
|
||||||
<span class="ident">cors_response</span>.<span class="ident">merge</span>(<span class="ident">response</span>);
|
|
||||||
|
|
||||||
<span class="comment">// If this was an OPTIONS request and no route can be found, we should turn this</span>
|
|
||||||
<span class="comment">// into a HTTP 204 with no content body.</span>
|
|
||||||
<span class="comment">// This allows the user to not have to specify an OPTIONS route for everything.</span>
|
|
||||||
<span class="comment">//</span>
|
|
||||||
<span class="comment">// TODO: Is there anyway we can make this smarter? Only modify status codes for</span>
|
|
||||||
<span class="comment">// requests where an actual route exist?</span>
|
|
||||||
<span class="kw">if</span> <span class="ident">request</span>.<span class="ident">method</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">Options</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">request</span>.<span class="ident">route</span>().<span class="ident">is_none</span>() {
|
|
||||||
<span class="macro">info_</span><span class="macro">!</span>(
|
|
||||||
<span class="string">"CORS Fairing: Turned missing route {} into an OPTIONS pre-flight request"</span>,
|
|
||||||
<span class="ident">request</span>
|
|
||||||
);
|
|
||||||
<span class="ident">response</span>.<span class="ident">set_status</span>(<span class="ident">Status</span>::<span class="ident">NoContent</span>);
|
|
||||||
<span class="kw">let</span> <span class="kw">_</span> <span class="op">=</span> <span class="ident">response</span>.<span class="ident">take_body</span>();
|
|
||||||
}
|
|
||||||
<span class="prelude-val">Ok</span>(())
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span> <span class="ident">rocket</span>::<span class="ident">fairing</span>::<span class="ident">Fairing</span> <span class="kw">for</span> <span class="ident">Cors</span> {
|
|
||||||
<span class="kw">fn</span> <span class="ident">info</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">rocket</span>::<span class="ident">fairing</span>::<span class="ident">Info</span> {
|
|
||||||
<span class="ident">rocket</span>::<span class="ident">fairing</span>::<span class="ident">Info</span> {
|
|
||||||
<span class="ident">name</span>: <span class="string">"CORS"</span>,
|
|
||||||
<span class="ident">kind</span>: <span class="ident">rocket</span>::<span class="ident">fairing</span>::<span class="ident">Kind</span>::<span class="ident">Attach</span>
|
|
||||||
<span class="op">|</span> <span class="ident">rocket</span>::<span class="ident">fairing</span>::<span class="ident">Kind</span>::<span class="ident">Request</span>
|
|
||||||
<span class="op">|</span> <span class="ident">rocket</span>::<span class="ident">fairing</span>::<span class="ident">Kind</span>::<span class="ident">Response</span>,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">on_attach</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">rocket</span>: <span class="ident">rocket</span>::<span class="ident">Rocket</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">rocket</span>::<span class="ident">Rocket</span>, <span class="ident">rocket</span>::<span class="ident">Rocket</span><span class="op">></span> {
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">rocket</span>.<span class="ident">mount</span>(
|
|
||||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">fairing_route_base</span>,
|
|
||||||
<span class="macro">vec</span><span class="macro">!</span>[<span class="ident">fairing_route</span>(<span class="self">self</span>.<span class="ident">fairing_route_rank</span>)],
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">on_request</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">request</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Request</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>, <span class="kw">_</span>: <span class="kw-2">&</span><span class="ident">rocket</span>::<span class="ident">Data</span>) {
|
|
||||||
<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">validate</span>(<span class="self">self</span>, <span class="ident">request</span>) {
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">CorsValidation</span>::<span class="ident">Success</span>,
|
|
||||||
<span class="prelude-val">Err</span>(<span class="ident">err</span>) <span class="op">=</span><span class="op">></span> {
|
|
||||||
<span class="macro">error_</span><span class="macro">!</span>(<span class="string">"CORS Error: {}"</span>, <span class="ident">err</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">status</span> <span class="op">=</span> <span class="ident">err</span>.<span class="ident">status</span>();
|
|
||||||
<span class="ident">route_to_fairing_error_handler</span>(<span class="self">self</span>, <span class="ident">status</span>.<span class="ident">code</span>, <span class="ident">request</span>);
|
|
||||||
<span class="ident">CorsValidation</span>::<span class="ident">Failure</span>
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="kw">_</span> <span class="op">=</span> <span class="ident">request</span>.<span class="ident">local_cache</span>(<span class="op">|</span><span class="op">|</span> <span class="ident">result</span>);
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">on_response</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">request</span>: <span class="kw-2">&</span><span class="ident">Request</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>, <span class="ident">response</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">rocket</span>::<span class="ident">Response</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) {
|
|
||||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Err</span>(<span class="ident">err</span>) <span class="op">=</span> <span class="ident">on_response_wrapper</span>(<span class="self">self</span>, <span class="ident">request</span>, <span class="ident">response</span>) {
|
|
||||||
<span class="macro">error_</span><span class="macro">!</span>(<span class="string">"Fairings on_response error: {}\nMost likely a bug"</span>, <span class="ident">err</span>);
|
|
||||||
<span class="ident">response</span>.<span class="ident">set_status</span>(<span class="ident">Status</span>::<span class="ident">InternalServerError</span>);
|
|
||||||
<span class="kw">let</span> <span class="kw">_</span> <span class="op">=</span> <span class="ident">response</span>.<span class="ident">take_body</span>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
|
||||||
<span class="kw">mod</span> <span class="ident">tests</span> {
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::<span class="ident">http</span>::{<span class="ident">Method</span>, <span class="ident">Status</span>};
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::<span class="ident">local</span>::<span class="ident">Client</span>;
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::<span class="ident">Rocket</span>;
|
|
||||||
|
|
||||||
<span class="kw">use</span> <span class="kw">crate</span>::{<span class="ident">AllowedHeaders</span>, <span class="ident">AllowedOrigins</span>, <span class="ident">Cors</span>, <span class="ident">CorsOptions</span>};
|
|
||||||
|
|
||||||
<span class="kw">const</span> <span class="ident">CORS_ROOT</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"/my_cors"</span>;
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">make_cors_options</span>() <span class="op">-</span><span class="op">></span> <span class="ident">Cors</span> {
|
|
||||||
<span class="kw">let</span> <span class="ident">allowed_origins</span> <span class="op">=</span> <span class="ident">AllowedOrigins</span>::<span class="ident">some_exact</span>(<span class="kw-2">&</span>[<span class="string">"https://www.acme.com"</span>]);
|
|
||||||
|
|
||||||
<span class="ident">CorsOptions</span> {
|
|
||||||
<span class="ident">allowed_origins</span>,
|
|
||||||
<span class="ident">allowed_methods</span>: <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Method</span>::<span class="ident">Get</span>].<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="ident">From</span>::<span class="ident">from</span>).<span class="ident">collect</span>(),
|
|
||||||
<span class="ident">allowed_headers</span>: <span class="ident">AllowedHeaders</span>::<span class="ident">some</span>(<span class="kw-2">&</span>[<span class="string">"Authorization"</span>, <span class="string">"Accept"</span>]),
|
|
||||||
<span class="ident">allow_credentials</span>: <span class="bool-val">true</span>,
|
|
||||||
<span class="ident">fairing_route_base</span>: <span class="ident">CORS_ROOT</span>.<span class="ident">to_string</span>(),
|
|
||||||
|
|
||||||
..<span class="ident">Default</span>::<span class="ident">default</span>()
|
|
||||||
}
|
|
||||||
.<span class="ident">to_cors</span>()
|
|
||||||
.<span class="ident">expect</span>(<span class="string">"Not to fail"</span>)
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">rocket</span>(<span class="ident">fairing</span>: <span class="ident">Cors</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Rocket</span> {
|
|
||||||
<span class="ident">Rocket</span>::<span class="ident">ignite</span>().<span class="ident">attach</span>(<span class="ident">fairing</span>)
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">fairing_error_route_returns_passed_in_status</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">Client</span>::<span class="ident">new</span>(<span class="ident">rocket</span>(<span class="ident">make_cors_options</span>())).<span class="ident">expect</span>(<span class="string">"to not fail"</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">request</span> <span class="op">=</span> <span class="ident">client</span>.<span class="ident">get</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/403"</span>, <span class="ident">CORS_ROOT</span>));
|
|
||||||
<span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="ident">request</span>.<span class="ident">dispatch</span>();
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Status</span>::<span class="ident">Forbidden</span>, <span class="ident">response</span>.<span class="ident">status</span>());
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">fairing_error_route_returns_500_for_unknown_status</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">Client</span>::<span class="ident">new</span>(<span class="ident">rocket</span>(<span class="ident">make_cors_options</span>())).<span class="ident">expect</span>(<span class="string">"to not fail"</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">request</span> <span class="op">=</span> <span class="ident">client</span>.<span class="ident">get</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/999"</span>, <span class="ident">CORS_ROOT</span>));
|
|
||||||
<span class="kw">let</span> <span class="ident">response</span> <span class="op">=</span> <span class="ident">request</span>.<span class="ident">dispatch</span>();
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Status</span>::<span class="ident">InternalServerError</span>, <span class="ident">response</span>.<span class="ident">status</span>());
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">error_route_is_mounted_on_attach</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">rocket</span> <span class="op">=</span> <span class="ident">rocket</span>(<span class="ident">make_cors_options</span>());
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">expected_uri</span> <span class="op">=</span> <span class="macro">format</span><span class="macro">!</span>(<span class="string">"{}/<status>"</span>, <span class="ident">CORS_ROOT</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">error_route</span> <span class="op">=</span> <span class="ident">rocket</span>
|
|
||||||
.<span class="ident">routes</span>()
|
|
||||||
.<span class="ident">find</span>(<span class="op">|</span><span class="ident">r</span><span class="op">|</span> <span class="ident">r</span>.<span class="ident">method</span> <span class="op">=</span><span class="op">=</span> <span class="ident">Method</span>::<span class="ident">Get</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">r</span>.<span class="ident">uri</span>.<span class="ident">to_string</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">expected_uri</span>);
|
|
||||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">error_route</span>.<span class="ident">is_some</span>());
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="comment">// Rest of the things can only be tested in integration tests</span>
|
|
||||||
}
|
|
||||||
</pre></div>
|
|
||||||
</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "rocket_cors";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
|
@ -1,719 +0,0 @@
|
||||||
<!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="Source to the Rust file `src/headers.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>headers.rs.html -- source</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="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[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">☰</div><a href='../../rocket_cors/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
|
|
||||||
<span id="2"> 2</span>
|
|
||||||
<span id="3"> 3</span>
|
|
||||||
<span id="4"> 4</span>
|
|
||||||
<span id="5"> 5</span>
|
|
||||||
<span id="6"> 6</span>
|
|
||||||
<span id="7"> 7</span>
|
|
||||||
<span id="8"> 8</span>
|
|
||||||
<span id="9"> 9</span>
|
|
||||||
<span id="10"> 10</span>
|
|
||||||
<span id="11"> 11</span>
|
|
||||||
<span id="12"> 12</span>
|
|
||||||
<span id="13"> 13</span>
|
|
||||||
<span id="14"> 14</span>
|
|
||||||
<span id="15"> 15</span>
|
|
||||||
<span id="16"> 16</span>
|
|
||||||
<span id="17"> 17</span>
|
|
||||||
<span id="18"> 18</span>
|
|
||||||
<span id="19"> 19</span>
|
|
||||||
<span id="20"> 20</span>
|
|
||||||
<span id="21"> 21</span>
|
|
||||||
<span id="22"> 22</span>
|
|
||||||
<span id="23"> 23</span>
|
|
||||||
<span id="24"> 24</span>
|
|
||||||
<span id="25"> 25</span>
|
|
||||||
<span id="26"> 26</span>
|
|
||||||
<span id="27"> 27</span>
|
|
||||||
<span id="28"> 28</span>
|
|
||||||
<span id="29"> 29</span>
|
|
||||||
<span id="30"> 30</span>
|
|
||||||
<span id="31"> 31</span>
|
|
||||||
<span id="32"> 32</span>
|
|
||||||
<span id="33"> 33</span>
|
|
||||||
<span id="34"> 34</span>
|
|
||||||
<span id="35"> 35</span>
|
|
||||||
<span id="36"> 36</span>
|
|
||||||
<span id="37"> 37</span>
|
|
||||||
<span id="38"> 38</span>
|
|
||||||
<span id="39"> 39</span>
|
|
||||||
<span id="40"> 40</span>
|
|
||||||
<span id="41"> 41</span>
|
|
||||||
<span id="42"> 42</span>
|
|
||||||
<span id="43"> 43</span>
|
|
||||||
<span id="44"> 44</span>
|
|
||||||
<span id="45"> 45</span>
|
|
||||||
<span id="46"> 46</span>
|
|
||||||
<span id="47"> 47</span>
|
|
||||||
<span id="48"> 48</span>
|
|
||||||
<span id="49"> 49</span>
|
|
||||||
<span id="50"> 50</span>
|
|
||||||
<span id="51"> 51</span>
|
|
||||||
<span id="52"> 52</span>
|
|
||||||
<span id="53"> 53</span>
|
|
||||||
<span id="54"> 54</span>
|
|
||||||
<span id="55"> 55</span>
|
|
||||||
<span id="56"> 56</span>
|
|
||||||
<span id="57"> 57</span>
|
|
||||||
<span id="58"> 58</span>
|
|
||||||
<span id="59"> 59</span>
|
|
||||||
<span id="60"> 60</span>
|
|
||||||
<span id="61"> 61</span>
|
|
||||||
<span id="62"> 62</span>
|
|
||||||
<span id="63"> 63</span>
|
|
||||||
<span id="64"> 64</span>
|
|
||||||
<span id="65"> 65</span>
|
|
||||||
<span id="66"> 66</span>
|
|
||||||
<span id="67"> 67</span>
|
|
||||||
<span id="68"> 68</span>
|
|
||||||
<span id="69"> 69</span>
|
|
||||||
<span id="70"> 70</span>
|
|
||||||
<span id="71"> 71</span>
|
|
||||||
<span id="72"> 72</span>
|
|
||||||
<span id="73"> 73</span>
|
|
||||||
<span id="74"> 74</span>
|
|
||||||
<span id="75"> 75</span>
|
|
||||||
<span id="76"> 76</span>
|
|
||||||
<span id="77"> 77</span>
|
|
||||||
<span id="78"> 78</span>
|
|
||||||
<span id="79"> 79</span>
|
|
||||||
<span id="80"> 80</span>
|
|
||||||
<span id="81"> 81</span>
|
|
||||||
<span id="82"> 82</span>
|
|
||||||
<span id="83"> 83</span>
|
|
||||||
<span id="84"> 84</span>
|
|
||||||
<span id="85"> 85</span>
|
|
||||||
<span id="86"> 86</span>
|
|
||||||
<span id="87"> 87</span>
|
|
||||||
<span id="88"> 88</span>
|
|
||||||
<span id="89"> 89</span>
|
|
||||||
<span id="90"> 90</span>
|
|
||||||
<span id="91"> 91</span>
|
|
||||||
<span id="92"> 92</span>
|
|
||||||
<span id="93"> 93</span>
|
|
||||||
<span id="94"> 94</span>
|
|
||||||
<span id="95"> 95</span>
|
|
||||||
<span id="96"> 96</span>
|
|
||||||
<span id="97"> 97</span>
|
|
||||||
<span id="98"> 98</span>
|
|
||||||
<span id="99"> 99</span>
|
|
||||||
<span id="100">100</span>
|
|
||||||
<span id="101">101</span>
|
|
||||||
<span id="102">102</span>
|
|
||||||
<span id="103">103</span>
|
|
||||||
<span id="104">104</span>
|
|
||||||
<span id="105">105</span>
|
|
||||||
<span id="106">106</span>
|
|
||||||
<span id="107">107</span>
|
|
||||||
<span id="108">108</span>
|
|
||||||
<span id="109">109</span>
|
|
||||||
<span id="110">110</span>
|
|
||||||
<span id="111">111</span>
|
|
||||||
<span id="112">112</span>
|
|
||||||
<span id="113">113</span>
|
|
||||||
<span id="114">114</span>
|
|
||||||
<span id="115">115</span>
|
|
||||||
<span id="116">116</span>
|
|
||||||
<span id="117">117</span>
|
|
||||||
<span id="118">118</span>
|
|
||||||
<span id="119">119</span>
|
|
||||||
<span id="120">120</span>
|
|
||||||
<span id="121">121</span>
|
|
||||||
<span id="122">122</span>
|
|
||||||
<span id="123">123</span>
|
|
||||||
<span id="124">124</span>
|
|
||||||
<span id="125">125</span>
|
|
||||||
<span id="126">126</span>
|
|
||||||
<span id="127">127</span>
|
|
||||||
<span id="128">128</span>
|
|
||||||
<span id="129">129</span>
|
|
||||||
<span id="130">130</span>
|
|
||||||
<span id="131">131</span>
|
|
||||||
<span id="132">132</span>
|
|
||||||
<span id="133">133</span>
|
|
||||||
<span id="134">134</span>
|
|
||||||
<span id="135">135</span>
|
|
||||||
<span id="136">136</span>
|
|
||||||
<span id="137">137</span>
|
|
||||||
<span id="138">138</span>
|
|
||||||
<span id="139">139</span>
|
|
||||||
<span id="140">140</span>
|
|
||||||
<span id="141">141</span>
|
|
||||||
<span id="142">142</span>
|
|
||||||
<span id="143">143</span>
|
|
||||||
<span id="144">144</span>
|
|
||||||
<span id="145">145</span>
|
|
||||||
<span id="146">146</span>
|
|
||||||
<span id="147">147</span>
|
|
||||||
<span id="148">148</span>
|
|
||||||
<span id="149">149</span>
|
|
||||||
<span id="150">150</span>
|
|
||||||
<span id="151">151</span>
|
|
||||||
<span id="152">152</span>
|
|
||||||
<span id="153">153</span>
|
|
||||||
<span id="154">154</span>
|
|
||||||
<span id="155">155</span>
|
|
||||||
<span id="156">156</span>
|
|
||||||
<span id="157">157</span>
|
|
||||||
<span id="158">158</span>
|
|
||||||
<span id="159">159</span>
|
|
||||||
<span id="160">160</span>
|
|
||||||
<span id="161">161</span>
|
|
||||||
<span id="162">162</span>
|
|
||||||
<span id="163">163</span>
|
|
||||||
<span id="164">164</span>
|
|
||||||
<span id="165">165</span>
|
|
||||||
<span id="166">166</span>
|
|
||||||
<span id="167">167</span>
|
|
||||||
<span id="168">168</span>
|
|
||||||
<span id="169">169</span>
|
|
||||||
<span id="170">170</span>
|
|
||||||
<span id="171">171</span>
|
|
||||||
<span id="172">172</span>
|
|
||||||
<span id="173">173</span>
|
|
||||||
<span id="174">174</span>
|
|
||||||
<span id="175">175</span>
|
|
||||||
<span id="176">176</span>
|
|
||||||
<span id="177">177</span>
|
|
||||||
<span id="178">178</span>
|
|
||||||
<span id="179">179</span>
|
|
||||||
<span id="180">180</span>
|
|
||||||
<span id="181">181</span>
|
|
||||||
<span id="182">182</span>
|
|
||||||
<span id="183">183</span>
|
|
||||||
<span id="184">184</span>
|
|
||||||
<span id="185">185</span>
|
|
||||||
<span id="186">186</span>
|
|
||||||
<span id="187">187</span>
|
|
||||||
<span id="188">188</span>
|
|
||||||
<span id="189">189</span>
|
|
||||||
<span id="190">190</span>
|
|
||||||
<span id="191">191</span>
|
|
||||||
<span id="192">192</span>
|
|
||||||
<span id="193">193</span>
|
|
||||||
<span id="194">194</span>
|
|
||||||
<span id="195">195</span>
|
|
||||||
<span id="196">196</span>
|
|
||||||
<span id="197">197</span>
|
|
||||||
<span id="198">198</span>
|
|
||||||
<span id="199">199</span>
|
|
||||||
<span id="200">200</span>
|
|
||||||
<span id="201">201</span>
|
|
||||||
<span id="202">202</span>
|
|
||||||
<span id="203">203</span>
|
|
||||||
<span id="204">204</span>
|
|
||||||
<span id="205">205</span>
|
|
||||||
<span id="206">206</span>
|
|
||||||
<span id="207">207</span>
|
|
||||||
<span id="208">208</span>
|
|
||||||
<span id="209">209</span>
|
|
||||||
<span id="210">210</span>
|
|
||||||
<span id="211">211</span>
|
|
||||||
<span id="212">212</span>
|
|
||||||
<span id="213">213</span>
|
|
||||||
<span id="214">214</span>
|
|
||||||
<span id="215">215</span>
|
|
||||||
<span id="216">216</span>
|
|
||||||
<span id="217">217</span>
|
|
||||||
<span id="218">218</span>
|
|
||||||
<span id="219">219</span>
|
|
||||||
<span id="220">220</span>
|
|
||||||
<span id="221">221</span>
|
|
||||||
<span id="222">222</span>
|
|
||||||
<span id="223">223</span>
|
|
||||||
<span id="224">224</span>
|
|
||||||
<span id="225">225</span>
|
|
||||||
<span id="226">226</span>
|
|
||||||
<span id="227">227</span>
|
|
||||||
<span id="228">228</span>
|
|
||||||
<span id="229">229</span>
|
|
||||||
<span id="230">230</span>
|
|
||||||
<span id="231">231</span>
|
|
||||||
<span id="232">232</span>
|
|
||||||
<span id="233">233</span>
|
|
||||||
<span id="234">234</span>
|
|
||||||
<span id="235">235</span>
|
|
||||||
<span id="236">236</span>
|
|
||||||
<span id="237">237</span>
|
|
||||||
<span id="238">238</span>
|
|
||||||
<span id="239">239</span>
|
|
||||||
<span id="240">240</span>
|
|
||||||
<span id="241">241</span>
|
|
||||||
<span id="242">242</span>
|
|
||||||
<span id="243">243</span>
|
|
||||||
<span id="244">244</span>
|
|
||||||
<span id="245">245</span>
|
|
||||||
<span id="246">246</span>
|
|
||||||
<span id="247">247</span>
|
|
||||||
<span id="248">248</span>
|
|
||||||
<span id="249">249</span>
|
|
||||||
<span id="250">250</span>
|
|
||||||
<span id="251">251</span>
|
|
||||||
<span id="252">252</span>
|
|
||||||
<span id="253">253</span>
|
|
||||||
<span id="254">254</span>
|
|
||||||
<span id="255">255</span>
|
|
||||||
<span id="256">256</span>
|
|
||||||
<span id="257">257</span>
|
|
||||||
<span id="258">258</span>
|
|
||||||
<span id="259">259</span>
|
|
||||||
<span id="260">260</span>
|
|
||||||
<span id="261">261</span>
|
|
||||||
<span id="262">262</span>
|
|
||||||
<span id="263">263</span>
|
|
||||||
<span id="264">264</span>
|
|
||||||
<span id="265">265</span>
|
|
||||||
<span id="266">266</span>
|
|
||||||
<span id="267">267</span>
|
|
||||||
<span id="268">268</span>
|
|
||||||
<span id="269">269</span>
|
|
||||||
<span id="270">270</span>
|
|
||||||
<span id="271">271</span>
|
|
||||||
<span id="272">272</span>
|
|
||||||
<span id="273">273</span>
|
|
||||||
<span id="274">274</span>
|
|
||||||
<span id="275">275</span>
|
|
||||||
<span id="276">276</span>
|
|
||||||
<span id="277">277</span>
|
|
||||||
<span id="278">278</span>
|
|
||||||
<span id="279">279</span>
|
|
||||||
<span id="280">280</span>
|
|
||||||
<span id="281">281</span>
|
|
||||||
<span id="282">282</span>
|
|
||||||
<span id="283">283</span>
|
|
||||||
<span id="284">284</span>
|
|
||||||
<span id="285">285</span>
|
|
||||||
<span id="286">286</span>
|
|
||||||
<span id="287">287</span>
|
|
||||||
<span id="288">288</span>
|
|
||||||
<span id="289">289</span>
|
|
||||||
<span id="290">290</span>
|
|
||||||
<span id="291">291</span>
|
|
||||||
<span id="292">292</span>
|
|
||||||
<span id="293">293</span>
|
|
||||||
<span id="294">294</span>
|
|
||||||
<span id="295">295</span>
|
|
||||||
<span id="296">296</span>
|
|
||||||
<span id="297">297</span>
|
|
||||||
<span id="298">298</span>
|
|
||||||
<span id="299">299</span>
|
|
||||||
<span id="300">300</span>
|
|
||||||
<span id="301">301</span>
|
|
||||||
<span id="302">302</span>
|
|
||||||
<span id="303">303</span>
|
|
||||||
<span id="304">304</span>
|
|
||||||
<span id="305">305</span>
|
|
||||||
<span id="306">306</span>
|
|
||||||
<span id="307">307</span>
|
|
||||||
<span id="308">308</span>
|
|
||||||
<span id="309">309</span>
|
|
||||||
<span id="310">310</span>
|
|
||||||
<span id="311">311</span>
|
|
||||||
<span id="312">312</span>
|
|
||||||
<span id="313">313</span>
|
|
||||||
<span id="314">314</span>
|
|
||||||
<span id="315">315</span>
|
|
||||||
<span id="316">316</span>
|
|
||||||
<span id="317">317</span>
|
|
||||||
<span id="318">318</span>
|
|
||||||
<span id="319">319</span>
|
|
||||||
<span id="320">320</span>
|
|
||||||
<span id="321">321</span>
|
|
||||||
<span id="322">322</span>
|
|
||||||
<span id="323">323</span>
|
|
||||||
<span id="324">324</span>
|
|
||||||
<span id="325">325</span>
|
|
||||||
<span id="326">326</span>
|
|
||||||
<span id="327">327</span>
|
|
||||||
<span id="328">328</span>
|
|
||||||
<span id="329">329</span>
|
|
||||||
<span id="330">330</span>
|
|
||||||
<span id="331">331</span>
|
|
||||||
<span id="332">332</span>
|
|
||||||
<span id="333">333</span>
|
|
||||||
<span id="334">334</span>
|
|
||||||
<span id="335">335</span>
|
|
||||||
<span id="336">336</span>
|
|
||||||
<span id="337">337</span>
|
|
||||||
<span id="338">338</span>
|
|
||||||
<span id="339">339</span>
|
|
||||||
<span id="340">340</span>
|
|
||||||
<span id="341">341</span>
|
|
||||||
<span id="342">342</span>
|
|
||||||
<span id="343">343</span>
|
|
||||||
<span id="344">344</span>
|
|
||||||
<span id="345">345</span>
|
|
||||||
<span id="346">346</span>
|
|
||||||
<span id="347">347</span>
|
|
||||||
<span id="348">348</span>
|
|
||||||
<span id="349">349</span>
|
|
||||||
<span id="350">350</span>
|
|
||||||
<span id="351">351</span>
|
|
||||||
<span id="352">352</span>
|
|
||||||
<span id="353">353</span>
|
|
||||||
<span id="354">354</span>
|
|
||||||
<span id="355">355</span>
|
|
||||||
<span id="356">356</span>
|
|
||||||
<span id="357">357</span>
|
|
||||||
<span id="358">358</span>
|
|
||||||
</pre><div class="example-wrap"><pre class="rust ">
|
|
||||||
<span class="doccomment">//! CORS specific Request Headers</span>
|
|
||||||
|
|
||||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashSet</span>;
|
|
||||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
|
|
||||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Deref</span>;
|
|
||||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
|
|
||||||
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::<span class="ident">http</span>::<span class="ident">Status</span>;
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::<span class="ident">request</span>::{<span class="self">self</span>, <span class="ident">FromRequest</span>};
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::{<span class="self">self</span>, <span class="ident">Outcome</span>};
|
|
||||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"serialization"</span>)]</span>
|
|
||||||
<span class="kw">use</span> <span class="ident">serde_derive</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
|
|
||||||
<span class="kw">use</span> <span class="ident">unicase</span>::<span class="ident">UniCase</span>;
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"serialization"</span>)]</span>
|
|
||||||
<span class="kw">use</span> <span class="ident">unicase_serde</span>;
|
|
||||||
|
|
||||||
<span class="doccomment">/// A case insensitive header name</span>
|
|
||||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Clone</span>, <span class="ident">Debug</span>, <span class="ident">Hash</span>)]</span>
|
|
||||||
<span class="attribute">#[<span class="ident">cfg_attr</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"serialization"</span>, <span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>))]</span>
|
|
||||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">HeaderFieldName</span>(
|
|
||||||
<span class="attribute">#[<span class="ident">cfg_attr</span>(<span class="ident">feature</span> <span class="op">=</span> <span class="string">"serialization"</span>, <span class="ident">serde</span>(<span class="ident">with</span> <span class="op">=</span> <span class="string">"unicase_serde::unicase"</span>))]</span> <span class="ident">UniCase</span><span class="op"><</span><span class="ident">String</span><span class="op">></span>,
|
|
||||||
);
|
|
||||||
|
|
||||||
<span class="kw">impl</span> <span class="ident">Deref</span> <span class="kw">for</span> <span class="ident">HeaderFieldName</span> {
|
|
||||||
<span class="kw">type</span> <span class="ident">Target</span> <span class="op">=</span> <span class="ident">String</span>;
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">deref</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="kw-2">&</span><span class="self">Self</span>::<span class="ident">Target</span> {
|
|
||||||
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">deref</span>()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">HeaderFieldName</span> {
|
|
||||||
<span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
|
|
||||||
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">fmt</span>(<span class="ident">f</span>)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span> <span class="ident">From</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span><span class="op">></span> <span class="kw">for</span> <span class="ident">HeaderFieldName</span> {
|
|
||||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">s</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
|
||||||
<span class="ident">HeaderFieldName</span>(<span class="ident">From</span>::<span class="ident">from</span>(<span class="ident">s</span>))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span> <span class="ident">From</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> <span class="kw">for</span> <span class="ident">HeaderFieldName</span> {
|
|
||||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">s</span>: <span class="ident">String</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
|
||||||
<span class="ident">HeaderFieldName</span>(<span class="ident">From</span>::<span class="ident">from</span>(<span class="ident">s</span>))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span> <span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">HeaderFieldName</span> {
|
|
||||||
<span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> <span class="op"><</span><span class="ident">String</span> <span class="kw">as</span> <span class="ident">FromStr</span><span class="op">></span>::<span class="prelude-val">Err</span>;
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">s</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span> {
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">HeaderFieldName</span>(<span class="ident">FromStr</span>::<span class="ident">from_str</span>(<span class="ident">s</span>)<span class="question-mark">?</span>))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="doccomment">/// A set of case insensitive header names</span>
|
|
||||||
<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">HeaderFieldNamesSet</span> <span class="op">=</span> <span class="ident">HashSet</span><span class="op"><</span><span class="ident">HeaderFieldName</span><span class="op">></span>;
|
|
||||||
|
|
||||||
<span class="doccomment">/// The `Origin` request header used in CORS</span>
|
|
||||||
<span class="doccomment">///</span>
|
|
||||||
<span class="doccomment">/// You can use this as a rocket [Request Guard](https://rocket.rs/guide/requests/#request-guards)</span>
|
|
||||||
<span class="doccomment">/// to ensure that `Origin` is passed in correctly.</span>
|
|
||||||
<span class="doccomment">///</span>
|
|
||||||
<span class="doccomment">/// Reference: [Mozilla](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin)</span>
|
|
||||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Clone</span>, <span class="ident">Hash</span>, <span class="ident">Debug</span>)]</span>
|
|
||||||
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Origin</span> {
|
|
||||||
<span class="doccomment">/// A `null` Origin</span>
|
|
||||||
<span class="ident">Null</span>,
|
|
||||||
<span class="doccomment">/// A well-formed origin that was parsed by [`url::Url::origin`]</span>
|
|
||||||
<span class="ident">Parsed</span>(<span class="ident">url</span>::<span class="ident">Origin</span>),
|
|
||||||
<span class="doccomment">/// An unknown "opaque" origin that could not be parsed</span>
|
|
||||||
<span class="ident">Opaque</span>(<span class="ident">String</span>),
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span> <span class="ident">Origin</span> {
|
|
||||||
<span class="doccomment">/// Perform an</span>
|
|
||||||
<span class="doccomment">/// [ASCII serialization](https://html.spec.whatwg.org/multipage/#ascii-serialisation-of-an-origin)</span>
|
|
||||||
<span class="doccomment">/// of this origin.</span>
|
|
||||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">ascii_serialization</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">String</span> {
|
|
||||||
<span class="self">self</span>.<span class="ident">to_string</span>()
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="doccomment">/// Returns whether the origin was parsed as non-opaque</span>
|
|
||||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_tuple</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
|
|
||||||
<span class="kw">match</span> <span class="self">self</span> {
|
|
||||||
<span class="ident">Origin</span>::<span class="ident">Null</span> <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
|
|
||||||
<span class="ident">Origin</span>::<span class="ident">Parsed</span>(<span class="kw-2">ref</span> <span class="ident">parsed</span>) <span class="op">=</span><span class="op">></span> <span class="ident">parsed</span>.<span class="ident">is_tuple</span>(),
|
|
||||||
<span class="ident">Origin</span>::<span class="ident">Opaque</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="bool-val">false</span>,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span> <span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">Origin</span> {
|
|
||||||
<span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> <span class="kw">crate</span>::<span class="ident">Error</span>;
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">input</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span> {
|
|
||||||
<span class="kw">if</span> <span class="ident">input</span>.<span class="ident">to_lowercase</span>() <span class="op">=</span><span class="op">=</span> <span class="string">"null"</span> {
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">Origin</span>::<span class="ident">Null</span>)
|
|
||||||
} <span class="kw">else</span> {
|
|
||||||
<span class="kw">match</span> <span class="kw">crate</span>::<span class="ident">to_origin</span>(<span class="ident">input</span>)<span class="question-mark">?</span> {
|
|
||||||
<span class="ident">url</span>::<span class="ident">Origin</span>::<span class="ident">Opaque</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">Origin</span>::<span class="ident">Opaque</span>(<span class="ident">input</span>.<span class="ident">to_string</span>())),
|
|
||||||
<span class="ident">parsed</span> @ <span class="ident">url</span>::<span class="ident">Origin</span>::<span class="ident">Tuple</span>(..) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">Origin</span>::<span class="ident">Parsed</span>(<span class="ident">parsed</span>)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">Origin</span> {
|
|
||||||
<span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span>) <span class="op">-</span><span class="op">></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
|
|
||||||
<span class="kw">match</span> <span class="self">self</span> {
|
|
||||||
<span class="ident">Origin</span>::<span class="ident">Null</span> <span class="op">=</span><span class="op">></span> <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"null"</span>),
|
|
||||||
<span class="ident">Origin</span>::<span class="ident">Parsed</span>(<span class="kw-2">ref</span> <span class="ident">parsed</span>) <span class="op">=</span><span class="op">></span> <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{}"</span>, <span class="ident">parsed</span>.<span class="ident">ascii_serialization</span>()),
|
|
||||||
<span class="ident">Origin</span>::<span class="ident">Opaque</span>(<span class="kw-2">ref</span> <span class="ident">opaque</span>) <span class="op">=</span><span class="op">></span> <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">"{}"</span>, <span class="ident">opaque</span>),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="lifetime">'r</span><span class="op">></span> <span class="ident">FromRequest</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="lifetime">'r</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Origin</span> {
|
|
||||||
<span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="kw">crate</span>::<span class="ident">Error</span>;
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">from_request</span>(<span class="ident">request</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">rocket</span>::<span class="ident">Request</span><span class="op"><</span><span class="lifetime">'r</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">request</span>::<span class="ident">Outcome</span><span class="op"><</span><span class="self">Self</span>, <span class="kw">crate</span>::<span class="ident">Error</span><span class="op">></span> {
|
|
||||||
<span class="kw">match</span> <span class="ident">request</span>.<span class="ident">headers</span>().<span class="ident">get_one</span>(<span class="string">"Origin"</span>) {
|
|
||||||
<span class="prelude-val">Some</span>(<span class="ident">origin</span>) <span class="op">=</span><span class="op">></span> <span class="kw">match</span> <span class="self">Self</span>::<span class="ident">from_str</span>(<span class="ident">origin</span>) {
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">origin</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Outcome</span>::<span class="ident">Success</span>(<span class="ident">origin</span>),
|
|
||||||
<span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Outcome</span>::<span class="ident">Failure</span>((<span class="ident">Status</span>::<span class="ident">BadRequest</span>, <span class="ident">e</span>)),
|
|
||||||
},
|
|
||||||
<span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">Outcome</span>::<span class="ident">Forward</span>(()),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<span class="doccomment">/// The `Access-Control-Request-Method` request header</span>
|
|
||||||
<span class="doccomment">///</span>
|
|
||||||
<span class="doccomment">/// You can use this as a rocket [Request Guard](https://rocket.rs/guide/requests/#request-guards)</span>
|
|
||||||
<span class="doccomment">/// to ensure that the header is passed in correctly.</span>
|
|
||||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
|
|
||||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">AccessControlRequestMethod</span>(<span class="kw">pub</span> <span class="kw">crate</span>::<span class="ident">Method</span>);
|
|
||||||
|
|
||||||
<span class="kw">impl</span> <span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">AccessControlRequestMethod</span> {
|
|
||||||
<span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> ();
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">method</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span> {
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">AccessControlRequestMethod</span>(<span class="kw">crate</span>::<span class="ident">Method</span>::<span class="ident">from_str</span>(<span class="ident">method</span>)<span class="question-mark">?</span>))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="lifetime">'r</span><span class="op">></span> <span class="ident">FromRequest</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="lifetime">'r</span><span class="op">></span> <span class="kw">for</span> <span class="ident">AccessControlRequestMethod</span> {
|
|
||||||
<span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="kw">crate</span>::<span class="ident">Error</span>;
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">from_request</span>(<span class="ident">request</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">rocket</span>::<span class="ident">Request</span><span class="op"><</span><span class="lifetime">'r</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">request</span>::<span class="ident">Outcome</span><span class="op"><</span><span class="self">Self</span>, <span class="kw">crate</span>::<span class="ident">Error</span><span class="op">></span> {
|
|
||||||
<span class="kw">match</span> <span class="ident">request</span>.<span class="ident">headers</span>().<span class="ident">get_one</span>(<span class="string">"Access-Control-Request-Method"</span>) {
|
|
||||||
<span class="prelude-val">Some</span>(<span class="ident">request_method</span>) <span class="op">=</span><span class="op">></span> <span class="kw">match</span> <span class="self">Self</span>::<span class="ident">from_str</span>(<span class="ident">request_method</span>) {
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">request_method</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Outcome</span>::<span class="ident">Success</span>(<span class="ident">request_method</span>),
|
|
||||||
<span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Outcome</span>::<span class="ident">Failure</span>((<span class="ident">Status</span>::<span class="ident">BadRequest</span>, <span class="kw">crate</span>::<span class="ident">Error</span>::<span class="ident">BadRequestMethod</span>)),
|
|
||||||
},
|
|
||||||
<span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">Outcome</span>::<span class="ident">Forward</span>(()),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="doccomment">/// The `Access-Control-Request-Headers` request header</span>
|
|
||||||
<span class="doccomment">///</span>
|
|
||||||
<span class="doccomment">/// You can use this as a rocket [Request Guard](https://rocket.rs/guide/requests/#request-guards)</span>
|
|
||||||
<span class="doccomment">/// to ensure that the header is passed in correctly.</span>
|
|
||||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Eq</span>, <span class="ident">PartialEq</span>, <span class="ident">Debug</span>)]</span>
|
|
||||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">AccessControlRequestHeaders</span>(<span class="kw">pub</span> <span class="ident">HeaderFieldNamesSet</span>);
|
|
||||||
|
|
||||||
<span class="doccomment">/// Will never fail</span>
|
|
||||||
<span class="kw">impl</span> <span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">AccessControlRequestHeaders</span> {
|
|
||||||
<span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> ();
|
|
||||||
|
|
||||||
<span class="doccomment">/// Will never fail</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">headers</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span> {
|
|
||||||
<span class="kw">if</span> <span class="ident">headers</span>.<span class="ident">trim</span>().<span class="ident">is_empty</span>() {
|
|
||||||
<span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="ident">AccessControlRequestHeaders</span>(<span class="ident">HashSet</span>::<span class="ident">new</span>()));
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">set</span>: <span class="ident">HeaderFieldNamesSet</span> <span class="op">=</span> <span class="ident">headers</span>
|
|
||||||
.<span class="ident">split</span>(<span class="string">','</span>)
|
|
||||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">header</span><span class="op">|</span> <span class="ident">From</span>::<span class="ident">from</span>(<span class="ident">header</span>.<span class="ident">trim</span>().<span class="ident">to_string</span>()))
|
|
||||||
.<span class="ident">collect</span>();
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">AccessControlRequestHeaders</span>(<span class="ident">set</span>))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="kw">impl</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="lifetime">'r</span><span class="op">></span> <span class="ident">FromRequest</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="lifetime">'r</span><span class="op">></span> <span class="kw">for</span> <span class="ident">AccessControlRequestHeaders</span> {
|
|
||||||
<span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="kw">crate</span>::<span class="ident">Error</span>;
|
|
||||||
|
|
||||||
<span class="kw">fn</span> <span class="ident">from_request</span>(<span class="ident">request</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">rocket</span>::<span class="ident">Request</span><span class="op"><</span><span class="lifetime">'r</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">request</span>::<span class="ident">Outcome</span><span class="op"><</span><span class="self">Self</span>, <span class="kw">crate</span>::<span class="ident">Error</span><span class="op">></span> {
|
|
||||||
<span class="kw">match</span> <span class="ident">request</span>.<span class="ident">headers</span>().<span class="ident">get_one</span>(<span class="string">"Access-Control-Request-Headers"</span>) {
|
|
||||||
<span class="prelude-val">Some</span>(<span class="ident">request_headers</span>) <span class="op">=</span><span class="op">></span> <span class="kw">match</span> <span class="self">Self</span>::<span class="ident">from_str</span>(<span class="ident">request_headers</span>) {
|
|
||||||
<span class="prelude-val">Ok</span>(<span class="ident">request_headers</span>) <span class="op">=</span><span class="op">></span> <span class="ident">Outcome</span>::<span class="ident">Success</span>(<span class="ident">request_headers</span>),
|
|
||||||
<span class="prelude-val">Err</span>(()) <span class="op">=</span><span class="op">></span> {
|
|
||||||
<span class="macro">unreachable</span><span class="macro">!</span>(<span class="string">"`AccessControlRequestHeaders::from_str` should never fail"</span>)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
<span class="prelude-val">None</span> <span class="op">=</span><span class="op">></span> <span class="ident">Outcome</span>::<span class="ident">Forward</span>(()),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
|
|
||||||
<span class="kw">mod</span> <span class="ident">tests</span> {
|
|
||||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">str</span>::<span class="ident">FromStr</span>;
|
|
||||||
|
|
||||||
<span class="kw">use</span> <span class="ident">hyper</span>;
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>;
|
|
||||||
<span class="kw">use</span> <span class="ident">rocket</span>::<span class="ident">local</span>::<span class="ident">Client</span>;
|
|
||||||
|
|
||||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
|
|
||||||
|
|
||||||
<span class="doccomment">/// Make a client with no routes for unit testing</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">make_client</span>() <span class="op">-</span><span class="op">></span> <span class="ident">Client</span> {
|
|
||||||
<span class="kw">let</span> <span class="ident">rocket</span> <span class="op">=</span> <span class="ident">rocket</span>::<span class="ident">ignite</span>();
|
|
||||||
<span class="ident">Client</span>::<span class="ident">new</span>(<span class="ident">rocket</span>).<span class="ident">expect</span>(<span class="string">"valid rocket instance"</span>)
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="comment">// `Origin::from_str` tests</span>
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">origin_is_parsed_properly</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">url</span> <span class="op">=</span> <span class="string">"https://foo.bar.xyz"</span>;
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">Origin</span>::<span class="ident">from_str</span>(<span class="ident">url</span>));
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">ascii_serialization</span>(), <span class="ident">url</span>);
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">origin_parsing_strips_paths</span>() {
|
|
||||||
<span class="comment">// this should never really be sent by a compliant user agent</span>
|
|
||||||
<span class="kw">let</span> <span class="ident">url</span> <span class="op">=</span> <span class="string">"https://foo.bar.xyz/path/somewhere"</span>;
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">Origin</span>::<span class="ident">from_str</span>(<span class="ident">url</span>));
|
|
||||||
<span class="kw">let</span> <span class="ident">expected</span> <span class="op">=</span> <span class="string">"https://foo.bar.xyz"</span>;
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">ascii_serialization</span>(), <span class="ident">expected</span>);
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="attribute">#[<span class="ident">should_panic</span>(<span class="ident">expected</span> <span class="op">=</span> <span class="string">"BadOrigin"</span>)]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">origin_parsing_disallows_invalid_origins</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">url</span> <span class="op">=</span> <span class="string">"invalid_url"</span>;
|
|
||||||
<span class="kw">let</span> <span class="kw">_</span> <span class="op">=</span> <span class="ident">Origin</span>::<span class="ident">from_str</span>(<span class="ident">url</span>).<span class="ident">unwrap</span>();
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">origin_parses_opaque_origins</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">url</span> <span class="op">=</span> <span class="string">"blob://foobar"</span>;
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">Origin</span>::<span class="ident">from_str</span>(<span class="ident">url</span>));
|
|
||||||
|
|
||||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">parsed</span>.<span class="ident">is_tuple</span>());
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="comment">// The following tests check that CORS Request headers are parsed correctly</span>
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">origin_header_conversion</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">url</span> <span class="op">=</span> <span class="string">"https://foo.bar.xyz"</span>;
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">Origin</span>::<span class="ident">from_str</span>(<span class="ident">url</span>));
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">ascii_serialization</span>(), <span class="ident">url</span>);
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">url</span> <span class="op">=</span> <span class="string">"https://foo.bar.xyz:1234"</span>;
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">Origin</span>::<span class="ident">from_str</span>(<span class="ident">url</span>));
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">ascii_serialization</span>(), <span class="ident">url</span>);
|
|
||||||
|
|
||||||
<span class="comment">// this should never really be sent by a compliant user agent</span>
|
|
||||||
<span class="kw">let</span> <span class="ident">url</span> <span class="op">=</span> <span class="string">"https://foo.bar.xyz/path/somewhere"</span>;
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">Origin</span>::<span class="ident">from_str</span>(<span class="ident">url</span>));
|
|
||||||
<span class="kw">let</span> <span class="ident">expected</span> <span class="op">=</span> <span class="string">"https://foo.bar.xyz"</span>;
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">ascii_serialization</span>(), <span class="ident">expected</span>);
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">url</span> <span class="op">=</span> <span class="string">"invalid_url"</span>;
|
|
||||||
<span class="kw">let</span> <span class="kw">_</span> <span class="op">=</span> <span class="macro">is_err</span><span class="macro">!</span>(<span class="ident">Origin</span>::<span class="ident">from_str</span>(<span class="ident">url</span>));
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">origin_header_parsing</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">make_client</span>();
|
|
||||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">request</span> <span class="op">=</span> <span class="ident">client</span>.<span class="ident">get</span>(<span class="string">"/"</span>);
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">origin</span> <span class="op">=</span> <span class="ident">hyper</span>::<span class="ident">header</span>::<span class="ident">Origin</span>::<span class="ident">new</span>(<span class="string">"https"</span>, <span class="string">"www.example.com"</span>, <span class="prelude-val">None</span>);
|
|
||||||
<span class="ident">request</span>.<span class="ident">add_header</span>(<span class="ident">origin</span>);
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">outcome</span>: <span class="ident">request</span>::<span class="ident">Outcome</span><span class="op"><</span><span class="ident">Origin</span>, <span class="kw">crate</span>::<span class="ident">Error</span><span class="op">></span> <span class="op">=</span>
|
|
||||||
<span class="ident">FromRequest</span>::<span class="ident">from_request</span>(<span class="ident">request</span>.<span class="ident">inner</span>());
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed_header</span> <span class="op">=</span> <span class="macro">assert_matches</span><span class="macro">!</span>(<span class="ident">outcome</span>, <span class="ident">Outcome</span>::<span class="ident">Success</span>(<span class="ident">s</span>), <span class="ident">s</span>);
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(
|
|
||||||
<span class="string">"https://www.example.com"</span>,
|
|
||||||
<span class="ident">parsed_header</span>.<span class="ident">ascii_serialization</span>()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">request_method_conversion</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">method</span> <span class="op">=</span> <span class="string">"POST"</span>;
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed_method</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">AccessControlRequestMethod</span>::<span class="ident">from_str</span>(<span class="ident">method</span>));
|
|
||||||
<span class="macro">assert_matches</span><span class="macro">!</span>(
|
|
||||||
<span class="ident">parsed_method</span>,
|
|
||||||
<span class="ident">AccessControlRequestMethod</span>(<span class="kw">crate</span>::<span class="ident">Method</span>(<span class="ident">rocket</span>::<span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">Post</span>))
|
|
||||||
);
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">method</span> <span class="op">=</span> <span class="string">"options"</span>;
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed_method</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">AccessControlRequestMethod</span>::<span class="ident">from_str</span>(<span class="ident">method</span>));
|
|
||||||
<span class="macro">assert_matches</span><span class="macro">!</span>(
|
|
||||||
<span class="ident">parsed_method</span>,
|
|
||||||
<span class="ident">AccessControlRequestMethod</span>(<span class="kw">crate</span>::<span class="ident">Method</span>(<span class="ident">rocket</span>::<span class="ident">http</span>::<span class="ident">Method</span>::<span class="ident">Options</span>))
|
|
||||||
);
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">method</span> <span class="op">=</span> <span class="string">"INVALID"</span>;
|
|
||||||
<span class="macro">is_err</span><span class="macro">!</span>(<span class="ident">AccessControlRequestMethod</span>::<span class="ident">from_str</span>(<span class="ident">method</span>));
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">request_method_parsing</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">make_client</span>();
|
|
||||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">request</span> <span class="op">=</span> <span class="ident">client</span>.<span class="ident">get</span>(<span class="string">"/"</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">method</span> <span class="op">=</span> <span class="ident">hyper</span>::<span class="ident">header</span>::<span class="ident">AccessControlRequestMethod</span>(<span class="ident">hyper</span>::<span class="ident">method</span>::<span class="ident">Method</span>::<span class="ident">Get</span>);
|
|
||||||
<span class="ident">request</span>.<span class="ident">add_header</span>(<span class="ident">method</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">outcome</span>: <span class="ident">request</span>::<span class="ident">Outcome</span><span class="op"><</span><span class="ident">AccessControlRequestMethod</span>, <span class="kw">crate</span>::<span class="ident">Error</span><span class="op">></span> <span class="op">=</span>
|
|
||||||
<span class="ident">FromRequest</span>::<span class="ident">from_request</span>(<span class="ident">request</span>.<span class="ident">inner</span>());
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed_header</span> <span class="op">=</span> <span class="macro">assert_matches</span><span class="macro">!</span>(<span class="ident">outcome</span>, <span class="ident">Outcome</span>::<span class="ident">Success</span>(<span class="ident">s</span>), <span class="ident">s</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">AccessControlRequestMethod</span>(<span class="ident">parsed_method</span>) <span class="op">=</span> <span class="ident">parsed_header</span>;
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">"GET"</span>, <span class="ident">parsed_method</span>.<span class="ident">as_str</span>());
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">request_headers_conversion</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> [<span class="string">"foo"</span>, <span class="string">"bar"</span>, <span class="string">"baz"</span>];
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed_headers</span> <span class="op">=</span> <span class="macro">not_err</span><span class="macro">!</span>(<span class="ident">AccessControlRequestHeaders</span>::<span class="ident">from_str</span>(<span class="kw-2">&</span><span class="ident">headers</span>.<span class="ident">join</span>(<span class="string">", "</span>)));
|
|
||||||
<span class="kw">let</span> <span class="ident">expected_headers</span>: <span class="ident">HeaderFieldNamesSet</span> <span class="op">=</span>
|
|
||||||
<span class="ident">headers</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> (<span class="kw-2">*</span><span class="ident">s</span>).<span class="ident">to_string</span>().<span class="ident">into</span>()).<span class="ident">collect</span>();
|
|
||||||
<span class="kw">let</span> <span class="ident">AccessControlRequestHeaders</span>(<span class="ident">actual_headers</span>) <span class="op">=</span> <span class="ident">parsed_headers</span>;
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">actual_headers</span>, <span class="ident">expected_headers</span>);
|
|
||||||
}
|
|
||||||
|
|
||||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
|
||||||
<span class="kw">fn</span> <span class="ident">request_headers_parsing</span>() {
|
|
||||||
<span class="kw">let</span> <span class="ident">client</span> <span class="op">=</span> <span class="ident">make_client</span>();
|
|
||||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">request</span> <span class="op">=</span> <span class="ident">client</span>.<span class="ident">get</span>(<span class="string">"/"</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> <span class="ident">hyper</span>::<span class="ident">header</span>::<span class="ident">AccessControlRequestHeaders</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
|
||||||
<span class="ident">FromStr</span>::<span class="ident">from_str</span>(<span class="string">"accept-language"</span>).<span class="ident">unwrap</span>(),
|
|
||||||
<span class="ident">FromStr</span>::<span class="ident">from_str</span>(<span class="string">"date"</span>).<span class="ident">unwrap</span>(),
|
|
||||||
]);
|
|
||||||
<span class="ident">request</span>.<span class="ident">add_header</span>(<span class="ident">headers</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">outcome</span>: <span class="ident">request</span>::<span class="ident">Outcome</span><span class="op"><</span><span class="ident">AccessControlRequestHeaders</span>, <span class="kw">crate</span>::<span class="ident">Error</span><span class="op">></span> <span class="op">=</span>
|
|
||||||
<span class="ident">FromRequest</span>::<span class="ident">from_request</span>(<span class="ident">request</span>.<span class="ident">inner</span>());
|
|
||||||
|
|
||||||
<span class="kw">let</span> <span class="ident">parsed_header</span> <span class="op">=</span> <span class="macro">assert_matches</span><span class="macro">!</span>(<span class="ident">outcome</span>, <span class="ident">Outcome</span>::<span class="ident">Success</span>(<span class="ident">s</span>), <span class="ident">s</span>);
|
|
||||||
<span class="kw">let</span> <span class="ident">AccessControlRequestHeaders</span>(<span class="ident">parsed_headers</span>) <span class="op">=</span> <span class="ident">parsed_header</span>;
|
|
||||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">parsed_headers</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> <span class="op">=</span>
|
|
||||||
<span class="ident">parsed_headers</span>.<span class="ident">iter</span>().<span class="ident">map</span>(<span class="ident">ToString</span>::<span class="ident">to_string</span>).<span class="ident">collect</span>();
|
|
||||||
<span class="ident">parsed_headers</span>.<span class="ident">sort</span>();
|
|
||||||
<span class="macro">assert_eq</span><span class="macro">!</span>(
|
|
||||||
<span class="macro">vec</span><span class="macro">!</span>[<span class="string">"accept-language"</span>.<span class="ident">to_string</span>(), <span class="string">"date"</span>.<span class="ident">to_string</span>()],
|
|
||||||
<span class="ident">parsed_headers</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</pre></div>
|
|
||||||
</section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "rocket_cors";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script><script defer src="../../search-index.js"></script></body></html>
|
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue