45 lines
34 KiB
HTML
45 lines
34 KiB
HTML
<!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> |