mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-24 21:17:01 +01:00
750 lines
185 KiB
HTML
750 lines
185 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="A parsed URL record."><meta name="keywords" content="rust, rustlang, rust-lang, Url"><title>Url in kanidmd_lib::prelude - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../kanidmd_lib/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../kanidmd_lib/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Url</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.as_str">as_str</a></li><li><a href="#method.cannot_be_a_base">cannot_be_a_base</a></li><li><a href="#method.deserialize_internal">deserialize_internal</a></li><li><a href="#method.domain">domain</a></li><li><a href="#method.fragment">fragment</a></li><li><a href="#method.from_directory_path">from_directory_path</a></li><li><a href="#method.from_file_path">from_file_path</a></li><li><a href="#method.has_authority">has_authority</a></li><li><a href="#method.has_host">has_host</a></li><li><a href="#method.host">host</a></li><li><a href="#method.host_str">host_str</a></li><li><a href="#method.into_string">into_string</a></li><li><a href="#method.join">join</a></li><li><a href="#method.make_relative">make_relative</a></li><li><a href="#method.options">options</a></li><li><a href="#method.origin">origin</a></li><li><a href="#method.parse">parse</a></li><li><a href="#method.parse_with_params">parse_with_params</a></li><li><a href="#method.password">password</a></li><li><a href="#method.path">path</a></li><li><a href="#method.path_segments">path_segments</a></li><li><a href="#method.path_segments_mut">path_segments_mut</a></li><li><a href="#method.port">port</a></li><li><a href="#method.port_or_known_default">port_or_known_default</a></li><li><a href="#method.query">query</a></li><li><a href="#method.query_pairs">query_pairs</a></li><li><a href="#method.query_pairs_mut">query_pairs_mut</a></li><li><a href="#method.scheme">scheme</a></li><li><a href="#method.serialize_internal">serialize_internal</a></li><li><a href="#method.set_fragment">set_fragment</a></li><li><a href="#method.set_host">set_host</a></li><li><a href="#method.set_ip_host">set_ip_host</a></li><li><a href="#method.set_password">set_password</a></li><li><a href="#method.set_path">set_path</a></li><li><a href="#method.set_port">set_port</a></li><li><a href="#method.set_query">set_query</a></li><li><a href="#method.set_scheme">set_scheme</a></li><li><a href="#method.set_username">set_username</a></li><li><a href="#method.socket_addrs">socket_addrs</a></li><li><a href="#method.to_file_path">to_file_path</a></li><li><a href="#method.username">username</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-AsRef%3Cstr%3E-for-Url">AsRef<str></a></li><li><a href="#impl-Clone-for-Url">Clone</a></li><li><a href="#impl-Debug-for-Url">Debug</a></li><li><a href="#impl-Deserialize%3C%27de%3E-for-Url">Deserialize<'de></a></li><li><a href="#impl-Display-for-Url">Display</a></li><li><a href="#impl-Eq-for-Url">Eq</a></li><li><a href="#impl-From%3CUrl%3E-for-PartialValue">From<Url></a></li><li><a href="#impl-From%3CUrl%3E-for-String">From<Url></a></li><li><a href="#impl-From%3CUrl%3E-for-Value">From<Url></a></li><li><a href="#impl-FromStr-for-Url">FromStr</a></li><li><a href="#impl-Hash-for-Url">Hash</a></li><li><a href="#impl-Index%3CRange%3CPosition%3E%3E-for-Url">Index<Range<Position>></a></li><li><a href="#impl-Index%3CRangeFrom%3CPosition%3E%3E-for-Url">Index<RangeFrom<Position>></a></li><li><a href="#impl-Index%3CRangeFull%3E-for-Url">Index<RangeFull></a></li><li><a href="#impl-Index%3CRangeTo%3CPosition%3E%3E-for-Url">Index<RangeTo<Position>></a></li><li><a href="#impl-Ord-for-Url">Ord</a></li><li><a href="#impl-PartialEq%3CUrl%3E-for-Url">PartialEq<Url></a></li><li><a href="#impl-PartialOrd%3CUrl%3E-for-Url">PartialOrd<Url></a></li><li><a href="#impl-Serialize-for-Url">Serialize</a></li><li><a href="#impl-ToListener%3CState%3E-for-Url">ToListener<State></a></li><li><a href="#impl-TryFrom%3C%26%27a%20str%3E-for-Url">TryFrom<&'a str></a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-Url">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Url">Send</a></li><li><a href="#impl-Sync-for-Url">Sync</a></li><li><a href="#impl-Unpin-for-Url">Unpin</a></li><li><a href="#impl-UnwindSafe-for-Url">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-Url">Any</a></li><li><a href="#impl-AsTaggedExplicit%3C%27a%3E-for-Url">AsTaggedExplicit<'a></a></li><li><a href="#impl-AsTaggedImplicit%3C%27a%3E-for-Url">AsTaggedImplicit<'a></a></li><li><a href="#impl-Borrow%3CT%3E-for-Url">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-Url">BorrowMut<T></a></li><li><a href="#impl-CallHasher-for-Url">CallHasher</a></li><li><a href="#impl-DeserializeOwned-for-Url">DeserializeOwned</a></li><li><a href="#impl-DynClone-for-Url">DynClone</a></li><li><a href="#impl-From%3CT%3E-for-Url">From<T></a></li><li><a href="#impl-Instrument-for-Url">Instrument</a></li><li><a href="#impl-Into%3CU%3E-for-Url">Into<U></a></li><li><a href="#impl-Pointable-for-Url">Pointable</a></li><li><a href="#impl-Same%3CT%3E-for-Url">Same<T></a></li><li><a href="#impl-Serialize-for-Url-1">Serialize</a></li><li><a href="#impl-ToOwned-for-Url">ToOwned</a></li><li><a href="#impl-ToString-for-Url">ToString</a></li><li><a href="#impl-TryFrom%3CU%3E-for-Url">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-Url">TryInto<U></a></li><li><a href="#impl-VZip%3CV%3E-for-Url">VZip<V></a></li><li><a href="#impl-WithSubscriber-for-Url">WithSubscriber</a></li></ul></section><h2><a href="index.html">In kanidmd_lib::prelude</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Struct <a href="../index.html">kanidmd_lib</a>::<wbr><a href="index.html">prelude</a>::<wbr><a class="struct" href="#">Url</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#170">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code>pub struct Url { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A parsed URL record.</p>
|
||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#256">source</a><a href="#impl-Url" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.parse" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#279">source</a><h4 class="code-header">pub fn <a href="#method.parse" class="fnname">parse</a>(input: &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <a class="enum" href="https://docs.rs/url/2.3.1/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>></h4></section></summary><div class="docblock"><p>Parse an absolute URL from a string.</p>
|
||
<h5 id="examples"><a href="#examples">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net"</span>)<span class="question-mark">?</span>;</code></pre></div>
|
||
<h5 id="errors"><a href="#errors">Errors</a></h5>
|
||
<p>If the function can not parse an absolute URL from the given string,
|
||
a <a href="enum.ParseError.html"><code>ParseError</code></a> variant will be returned.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.parse_with_params" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#309-314">source</a><h4 class="code-header">pub fn <a href="#method.parse_with_params" class="fnname">parse_with_params</a><I, K, V>(<br> input: &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>,<br> iter: I<br>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <a class="enum" href="https://docs.rs/url/2.3.1/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>><span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> <I as <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.66.1/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.tuple.html">(K, V)</a>>,<br> K: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>>,<br> V: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>>,</span></h4></section></summary><div class="docblock"><p>Parse an absolute URL from a string and add params to its query string.</p>
|
||
<p>Existing params are not removed.</p>
|
||
<h5 id="examples-1"><a href="#examples-1">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse_with_params(<span class="string">"https://example.net?dont=clobberme"</span>,
|
||
<span class="kw-2">&</span>[(<span class="string">"lang"</span>, <span class="string">"rust"</span>), (<span class="string">"browser"</span>, <span class="string">"servo"</span>)])<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(<span class="string">"https://example.net/?dont=clobberme&lang=rust&browser=servo"</span>, url.as_str());</code></pre></div>
|
||
<h5 id="errors-1"><a href="#errors-1">Errors</a></h5>
|
||
<p>If the function can not parse an absolute URL from the given string,
|
||
a <a href="enum.ParseError.html"><code>ParseError</code></a> variant will be returned.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.join" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#360">source</a><h4 class="code-header">pub fn <a href="#method.join" class="fnname">join</a>(&self, input: &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <a class="enum" href="https://docs.rs/url/2.3.1/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>></h4></section></summary><div class="docblock"><p>Parse a string as an URL, with this URL as the base URL.</p>
|
||
<p>The inverse of this is <a href="#method.make_relative"><code>make_relative</code></a>.</p>
|
||
<p>Note: a trailing slash is significant.
|
||
Without it, the last path component is considered to be a “file” name
|
||
to be removed to get at the “directory” that is used as the base:</p>
|
||
<h5 id="examples-2"><a href="#examples-2">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b.html"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = base.join(<span class="string">"c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.net/a/c.png"</span>); <span class="comment">// Not /a/b.html/c.png
|
||
|
||
</span><span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b/"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = base.join(<span class="string">"c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.net/a/b/c.png"</span>);</code></pre></div>
|
||
<h5 id="errors-2"><a href="#errors-2">Errors</a></h5>
|
||
<p>If the function can not parse an URL from the given string
|
||
with this URL as the base URL, a <a href="enum.ParseError.html"><code>ParseError</code></a> variant will be returned.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.make_relative" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#405">source</a><h4 class="code-header">pub fn <a href="#method.make_relative" class="fnname">make_relative</a>(&self, url: &<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></h4></section></summary><div class="docblock"><p>Creates a relative URL if possible, with this URL as the base URL.</p>
|
||
<p>This is the inverse of <a href="#method.join"><code>join</code></a>.</p>
|
||
<h5 id="examples-3"><a href="#examples-3">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b.html"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net/a/c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>relative = base.make_relative(<span class="kw-2">&</span>url);
|
||
<span class="macro">assert_eq!</span>(relative.as_ref().map(|s| s.as_str()), <span class="prelude-val">Some</span>(<span class="string">"c.png"</span>));
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b/"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net/a/b/c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>relative = base.make_relative(<span class="kw-2">&</span>url);
|
||
<span class="macro">assert_eq!</span>(relative.as_ref().map(|s| s.as_str()), <span class="prelude-val">Some</span>(<span class="string">"c.png"</span>));
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b/"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net/a/d/c.png"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>relative = base.make_relative(<span class="kw-2">&</span>url);
|
||
<span class="macro">assert_eq!</span>(relative.as_ref().map(|s| s.as_str()), <span class="prelude-val">Some</span>(<span class="string">"../d/c.png"</span>));
|
||
|
||
<span class="kw">let </span>base = Url::parse(<span class="string">"https://example.net/a/b.html?c=d"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.net/a/b.html?e=f"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>relative = base.make_relative(<span class="kw-2">&</span>url);
|
||
<span class="macro">assert_eq!</span>(relative.as_ref().map(|s| s.as_str()), <span class="prelude-val">Some</span>(<span class="string">"?e=f"</span>));</code></pre></div>
|
||
<h5 id="errors-3"><a href="#errors-3">Errors</a></h5>
|
||
<p>If this URL can’t be a base for the given URL, <code>None</code> is returned.
|
||
This is for example the case if the scheme, host or port are not the same.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.options" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#515">source</a><h4 class="code-header">pub fn <a href="#method.options" class="fnname">options</a><'a>() -> <a class="struct" href="https://docs.rs/url/2.3.1/url/struct.ParseOptions.html" title="struct url::ParseOptions">ParseOptions</a><'a></h4></section></summary><div class="docblock"><p>Return a default <code>ParseOptions</code> that can fully configure the URL parser.</p>
|
||
<h5 id="examples-4"><a href="#examples-4">Examples</a></h5>
|
||
<p>Get default <code>ParseOptions</code>, then change base url</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
<span class="kw">let </span>options = Url::options();
|
||
<span class="kw">let </span>api = Url::parse(<span class="string">"https://api.example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>base_url = options.base_url(<span class="prelude-val">Some</span>(<span class="kw-2">&</span>api));
|
||
<span class="kw">let </span>version_url = base_url.parse(<span class="string">"version.json"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(version_url.as_str(), <span class="string">"https://api.example.com/version.json"</span>);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.as_str" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#542">source</a><h4 class="code-header">pub fn <a href="#method.as_str" class="fnname">as_str</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the serialization of this URL.</p>
|
||
<p>This is fast since that serialization is already stored in the <code>Url</code> struct.</p>
|
||
<h5 id="examples-5"><a href="#examples-5">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url_str = <span class="string">"https://example.net/"</span>;
|
||
<span class="kw">let </span>url = Url::parse(url_str)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), url_str);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_string" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#566">source</a><h4 class="code-header">pub fn <a href="#method.into_string" class="fnname">into_string</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/1.66.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 2.3.0: use Into<String></span></div></span></summary><div class="docblock"><p>Return the serialization of this URL.</p>
|
||
<p>This consumes the <code>Url</code> and takes ownership of the <code>String</code> stored in it.</p>
|
||
<h5 id="examples-6"><a href="#examples-6">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url_str = <span class="string">"https://example.net/"</span>;
|
||
<span class="kw">let </span>url = Url::parse(url_str)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(String::from(url), url_str);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.origin" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#765">source</a><h4 class="code-header">pub fn <a href="#method.origin" class="fnname">origin</a>(&self) -> <a class="enum" href="https://docs.rs/url/2.3.1/url/origin/enum.Origin.html" title="enum url::origin::Origin">Origin</a></h4></section></summary><div class="docblock"><p>Return the origin of this URL (<a href="https://url.spec.whatwg.org/#origin">https://url.spec.whatwg.org/#origin</a>)</p>
|
||
<p>Note: this returns an opaque origin for <code>file:</code> URLs, which causes
|
||
<code>url.origin() != url.origin()</code>.</p>
|
||
<h5 id="examples-7"><a href="#examples-7">Examples</a></h5>
|
||
<p>URL with <code>ftp</code> scheme:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Host, Origin, Url};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://example.com/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.origin(),
|
||
Origin::Tuple(<span class="string">"ftp"</span>.into(),
|
||
Host::Domain(<span class="string">"example.com"</span>.into()),
|
||
<span class="number">21</span>));</code></pre></div>
|
||
<p>URL with <code>blob</code> scheme:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Host, Origin, Url};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"blob:https://example.com/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.origin(),
|
||
Origin::Tuple(<span class="string">"https"</span>.into(),
|
||
Host::Domain(<span class="string">"example.com"</span>.into()),
|
||
<span class="number">443</span>));</code></pre></div>
|
||
<p>URL with <code>file</code> scheme:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Host, Origin, Url};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"file:///tmp/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.origin().is_tuple());
|
||
|
||
<span class="kw">let </span>other_url = Url::parse(<span class="string">"file:///tmp/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.origin() != other_url.origin());</code></pre></div>
|
||
<p>URL with other scheme:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Host, Origin, Url};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"foo:bar"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.origin().is_tuple());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.scheme" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#785">source</a><h4 class="code-header">pub fn <a href="#method.scheme" class="fnname">scheme</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the scheme of this URL, lower-cased, as an ASCII string without the ‘:’ delimiter.</p>
|
||
<h5 id="examples-8"><a href="#examples-8">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"file:///tmp/foo"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.scheme(), <span class="string">"file"</span>);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.has_authority" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#815">source</a><h4 class="code-header">pub fn <a href="#method.has_authority" class="fnname">has_authority</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return whether the URL has an ‘authority’,
|
||
which can contain a username, password, host, and port number.</p>
|
||
<p>URLs that do <em>not</em> are either path-only like <code>unix:/run/foo.socket</code>
|
||
or cannot-be-a-base like <code>data:text/plain,Stuff</code>.</p>
|
||
<h5 id="examples-9"><a href="#examples-9">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.has_authority());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.has_authority());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.has_authority());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cannot_be_a_base" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#846">source</a><h4 class="code-header">pub fn <a href="#method.cannot_be_a_base" class="fnname">cannot_be_a_base</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return whether this URL is a cannot-be-a-base URL,
|
||
meaning that parsing a relative URL string with this URL as the base will return an error.</p>
|
||
<p>This is the case if the scheme and <code>:</code> delimiter are not followed by a <code>/</code> slash,
|
||
as is typically the case of <code>data:</code> and <code>mailto:</code> URLs.</p>
|
||
<h5 id="examples-10"><a href="#examples-10">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.cannot_be_a_base());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.cannot_be_a_base());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.cannot_be_a_base());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.username" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#872">source</a><h4 class="code-header">pub fn <a href="#method.username" class="fnname">username</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the username for this URL (typically the empty string)
|
||
as a percent-encoded ASCII string.</p>
|
||
<h5 id="examples-11"><a href="#examples-11">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.username(), <span class="string">"rms"</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://:secret123@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.username(), <span class="string">""</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.username(), <span class="string">""</span>);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.password" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#905">source</a><h4 class="code-header">pub fn <a href="#method.password" class="fnname">password</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Return the password for this URL, if any, as a percent-encoded ASCII string.</p>
|
||
<h5 id="examples-12"><a href="#examples-12">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms:secret123@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">Some</span>(<span class="string">"secret123"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://:secret123@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">Some</span>(<span class="string">"secret123"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">None</span>);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.has_host" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#940">source</a><h4 class="code-header">pub fn <a href="#method.has_host" class="fnname">has_host</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Equivalent to <code>url.host().is_some()</code>.</p>
|
||
<h5 id="examples-13"><a href="#examples-13">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.has_host());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.has_host());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(!url.has_host());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.host_str" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#977">source</a><h4 class="code-header">pub fn <a href="#method.host_str" class="fnname">host_str</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Return the string representation of the host (domain or IP address) for this URL, if any.</p>
|
||
<p>Non-ASCII domains are punycode-encoded per IDNA if this is the host
|
||
of a special URL, or percent encoded for non-special URLs.
|
||
IPv6 addresses are given between <code>[</code> and <code>]</code> brackets.</p>
|
||
<p>Cannot-be-a-base URLs (typical of <code>data:</code> and <code>mailto:</code>) and some <code>file:</code> URLs
|
||
don’t have a host.</p>
|
||
<p>See also the <code>host</code> method.</p>
|
||
<h5 id="examples-14"><a href="#examples-14">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://127.0.0.1/index.html"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">Some</span>(<span class="string">"127.0.0.1"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">Some</span>(<span class="string">"example.com"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">None</span>);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.host" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1016">source</a><h4 class="code-header">pub fn <a href="#method.host" class="fnname">host</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://docs.rs/url/2.3.1/url/host/enum.Host.html" title="enum url::host::Host">Host</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>>></h4></section></summary><div class="docblock"><p>Return the parsed representation of the host for this URL.
|
||
Non-ASCII domain labels are punycode-encoded per IDNA if this is the host
|
||
of a special URL, or percent encoded for non-special URLs.</p>
|
||
<p>Cannot-be-a-base URLs (typical of <code>data:</code> and <code>mailto:</code>) and some <code>file:</code> URLs
|
||
don’t have a host.</p>
|
||
<p>See also the <code>host_str</code> method.</p>
|
||
<h5 id="examples-15"><a href="#examples-15">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://127.0.0.1/index.html"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.host().is_some());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ftp://rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.host().is_some());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"unix:/run/foo.socket"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.host().is_none());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,Stuff"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.host().is_none());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.domain" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1048">source</a><h4 class="code-header">pub fn <a href="#method.domain" class="fnname">domain</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>If this URL has a host and it is a domain name (not an IP address), return it.
|
||
Non-ASCII domains are punycode-encoded per IDNA if this is the host
|
||
of a special URL, or percent encoded for non-special URLs.</p>
|
||
<h5 id="examples-16"><a href="#examples-16">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://127.0.0.1/"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.domain(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"mailto:rms@example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.domain(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.domain(), <span class="prelude-val">Some</span>(<span class="string">"example.com"</span>));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.port" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1080">source</a><h4 class="code-header">pub fn <a href="#method.port" class="fnname">port</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.u16.html">u16</a>></h4></section></summary><div class="docblock"><p>Return the port number for this URL, if any.</p>
|
||
<p>Note that default port numbers are never reflected by the serialization,
|
||
use the <code>port_or_known_default()</code> method if you want a default port number returned.</p>
|
||
<h5 id="examples-17"><a href="#examples-17">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com:443/"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"ssh://example.com:22"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port(), <span class="prelude-val">Some</span>(<span class="number">22</span>));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.port_or_known_default" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1112">source</a><h4 class="code-header">pub fn <a href="#method.port_or_known_default" class="fnname">port_or_known_default</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.u16.html">u16</a>></h4></section></summary><div class="docblock"><p>Return the port number for this URL, or the default port number if it is known.</p>
|
||
<p>This method only knows the default port number
|
||
of the <code>http</code>, <code>https</code>, <code>ws</code>, <code>wss</code> and <code>ftp</code> schemes.</p>
|
||
<p>For URLs in these schemes, this method always returns <code>Some(_)</code>.
|
||
For other schemes, it is the same as <code>Url::port()</code>.</p>
|
||
<h5 id="examples-18"><a href="#examples-18">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"foo://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port_or_known_default(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"foo://example.com:1456"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port_or_known_default(), <span class="prelude-val">Some</span>(<span class="number">1456</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.port_or_known_default(), <span class="prelude-val">Some</span>(<span class="number">443</span>));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.socket_addrs" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1143-1146">source</a><h4 class="code-header">pub fn <a href="#method.socket_addrs" class="fnname">socket_addrs</a>(<br> &self,<br> default_port_number: impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>() -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.u16.html">u16</a>><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="https://doc.rust-lang.org/1.66.1/std/net/socket_addr/enum.SocketAddr.html" title="enum std::net::socket_addr::SocketAddr">SocketAddr</a>, <a class="struct" href="https://doc.rust-lang.org/1.66.1/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <a class="struct" href="https://doc.rust-lang.org/1.66.1/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><div class="docblock"><p>Resolve a URL’s host and port number to <code>SocketAddr</code>.</p>
|
||
<p>If the URL has the default port number of a scheme that is unknown to this library,
|
||
<code>default_port_number</code> provides an opportunity to provide the actual port number.
|
||
In non-example code this should be implemented either simply as <code>|| None</code>,
|
||
or by matching on the URL’s <code>.scheme()</code>.</p>
|
||
<p>If the host is a domain, it is resolved using the standard library’s DNS support.</p>
|
||
<h5 id="examples-19"><a href="#examples-19">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>url = url::Url::parse(<span class="string">"https://example.net/"</span>).unwrap();
|
||
<span class="kw">let </span>addrs = url.socket_addrs(|| <span class="prelude-val">None</span>).unwrap();
|
||
std::net::TcpStream::connect(<span class="kw-2">&*</span>addrs)</code></pre></div>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="doccomment">/// With application-specific known default port numbers
|
||
</span><span class="kw">fn </span>socket_addrs(url: url::Url) -> std::io::Result<Vec<std::net::SocketAddr>> {
|
||
url.socket_addrs(|| <span class="kw">match </span>url.scheme() {
|
||
<span class="string">"socks5" </span>| <span class="string">"socks5h" </span>=> <span class="prelude-val">Some</span>(<span class="number">1080</span>),
|
||
<span class="kw">_ </span>=> <span class="prelude-val">None</span>,
|
||
})
|
||
}</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.path" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1194">source</a><h4 class="code-header">pub fn <a href="#method.path" class="fnname">path</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Return the path for this URL, as a percent-encoded ASCII string.
|
||
For cannot-be-a-base URLs, this is an arbitrary string that doesn’t start with ‘/’.
|
||
For other URLs, this starts with a ‘/’ slash
|
||
and continues with slash-separated path segments.</p>
|
||
<h5 id="examples-20"><a href="#examples-20">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Url, ParseError};
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/api/versions?page=2"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/api/versions"</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/"</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/countries/việt nam"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/countries/vi%E1%BB%87t%20nam"</span>);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.path_segments" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1241">source</a><h4 class="code-header">pub fn <a href="#method.path_segments" class="fnname">path_segments</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/core/str/iter/struct.Split.html" title="struct core::str::iter::Split">Split</a><'_, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.char.html">char</a>>></h4></section></summary><div class="docblock"><p>Unless this URL is cannot-be-a-base,
|
||
return an iterator of ‘/’ slash-separated path segments,
|
||
each as a percent-encoded ASCII string.</p>
|
||
<p>Return <code>None</code> for cannot-be-a-base URLs.</p>
|
||
<p>When <code>Some</code> is returned, the iterator always contains at least one string
|
||
(which may be empty).</p>
|
||
<h5 id="examples-21"><a href="#examples-21">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/foo/bar"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>path_segments = url.path_segments().ok_or_else(|| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">"foo"</span>));
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">"bar"</span>));
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>path_segments = url.path_segments().ok_or_else(|| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">""</span>));
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">None</span>);
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"data:text/plain,HelloWorld"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.path_segments().is_none());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/countries/việt nam"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>path_segments = url.path_segments().ok_or_else(|| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">"countries"</span>));
|
||
<span class="macro">assert_eq!</span>(path_segments.next(), <span class="prelude-val">Some</span>(<span class="string">"vi%E1%BB%87t%20nam"</span>));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.query" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1270">source</a><h4 class="code-header">pub fn <a href="#method.query" class="fnname">query</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Return this URL’s query string, if any, as a percent-encoded ASCII string.</p>
|
||
<h5 id="examples-22"><a href="#examples-22">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">fn </span>run() -> <span class="prelude-ty">Result</span><(), ParseError> {
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/products?page=2"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>query = url.query();
|
||
<span class="macro">assert_eq!</span>(query, <span class="prelude-val">Some</span>(<span class="string">"page=2"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/products"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>query = url.query();
|
||
<span class="macro">assert!</span>(query.is_none());
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/?country=español"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>query = url.query();
|
||
<span class="macro">assert_eq!</span>(query, <span class="prelude-val">Some</span>(<span class="string">"country=espa%C3%B1ol"</span>));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.query_pairs" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1309">source</a><h4 class="code-header">pub fn <a href="#method.query_pairs" class="fnname">query_pairs</a>(&self) -> Parse<'_></h4></section></summary><div class="docblock"><p>Parse the URL’s query string, if any, as <code>application/x-www-form-urlencoded</code>
|
||
and return an iterator of (key, value) pairs.</p>
|
||
<h5 id="examples-23"><a href="#examples-23">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::borrow::Cow;
|
||
|
||
<span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/products?page=2&sort=desc"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span><span class="kw-2">mut </span>pairs = url.query_pairs();
|
||
|
||
<span class="macro">assert_eq!</span>(pairs.count(), <span class="number">2</span>);
|
||
|
||
<span class="macro">assert_eq!</span>(pairs.next(), <span class="prelude-val">Some</span>((Cow::Borrowed(<span class="string">"page"</span>), Cow::Borrowed(<span class="string">"2"</span>))));
|
||
<span class="macro">assert_eq!</span>(pairs.next(), <span class="prelude-val">Some</span>((Cow::Borrowed(<span class="string">"sort"</span>), Cow::Borrowed(<span class="string">"desc"</span>))));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fragment" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1345">source</a><h4 class="code-header">pub fn <a href="#method.fragment" class="fnname">fragment</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>></h4></section></summary><div class="docblock"><p>Return this URL’s fragment identifier, if any.</p>
|
||
<p>A fragment is the part of the URL after the <code>#</code> symbol.
|
||
The fragment is optional and, if present, contains a fragment identifier
|
||
that identifies a secondary resource, such as a section heading
|
||
of a document.</p>
|
||
<p>In HTML, the fragment identifier is usually the id attribute of a an element
|
||
that is scrolled to on load. Browsers typically will not send the fragment portion
|
||
of a URL to the server.</p>
|
||
<p><strong>Note:</strong> the parser did <em>not</em> percent-encode this component,
|
||
but the input may have been percent-encoded already.</p>
|
||
<h5 id="examples-24"><a href="#examples-24">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/data.csv#row=4"</span>)<span class="question-mark">?</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(url.fragment(), <span class="prelude-val">Some</span>(<span class="string">"row=4"</span>));
|
||
|
||
<span class="kw">let </span>url = Url::parse(<span class="string">"https://example.com/data.csv#cell=4,1-6,2"</span>)<span class="question-mark">?</span>;
|
||
|
||
<span class="macro">assert_eq!</span>(url.fragment(), <span class="prelude-val">Some</span>(<span class="string">"cell=4,1-6,2"</span>));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_fragment" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1382">source</a><h4 class="code-header">pub fn <a href="#method.set_fragment" class="fnname">set_fragment</a>(&mut self, fragment: <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>>)</h4></section></summary><div class="docblock"><p>Change this URL’s fragment identifier.</p>
|
||
<h5 id="examples-25"><a href="#examples-25">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.com/data.csv"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/data.csv"</span>);
|
||
url.set_fragment(<span class="prelude-val">Some</span>(<span class="string">"cell=4,1-6,2"</span>));
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/data.csv#cell=4,1-6,2"</span>);
|
||
<span class="macro">assert_eq!</span>(url.fragment(), <span class="prelude-val">Some</span>(<span class="string">"cell=4,1-6,2"</span>));
|
||
|
||
url.set_fragment(<span class="prelude-val">None</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/data.csv"</span>);
|
||
<span class="macro">assert!</span>(url.fragment().is_none());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_query" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1435">source</a><h4 class="code-header">pub fn <a href="#method.set_query" class="fnname">set_query</a>(&mut self, query: <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>>)</h4></section></summary><div class="docblock"><p>Change this URL’s query string.</p>
|
||
<h5 id="examples-26"><a href="#examples-26">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.com/products"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/products"</span>);
|
||
|
||
url.set_query(<span class="prelude-val">Some</span>(<span class="string">"page=2"</span>));
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/products?page=2"</span>);
|
||
<span class="macro">assert_eq!</span>(url.query(), <span class="prelude-val">Some</span>(<span class="string">"page=2"</span>));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.query_pairs_mut" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1494">source</a><h4 class="code-header">pub fn <a href="#method.query_pairs_mut" class="fnname">query_pairs_mut</a>(&mut self) -> Serializer<'_, <a class="struct" href="https://docs.rs/url/2.3.1/url/struct.UrlQuery.html" title="struct url::UrlQuery">UrlQuery</a><'_>></h4></section></summary><div class="docblock"><p>Manipulate this URL’s query string, viewed as a sequence of name/value pairs
|
||
in <code>application/x-www-form-urlencoded</code> syntax.</p>
|
||
<p>The return value has a method-chaining API:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.net?lang=fr#nav"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.query(), <span class="prelude-val">Some</span>(<span class="string">"lang=fr"</span>));
|
||
|
||
url.query_pairs_mut().append_pair(<span class="string">"foo"</span>, <span class="string">"bar"</span>);
|
||
<span class="macro">assert_eq!</span>(url.query(), <span class="prelude-val">Some</span>(<span class="string">"lang=fr&foo=bar"</span>));
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.net/?lang=fr&foo=bar#nav"</span>);
|
||
|
||
url.query_pairs_mut()
|
||
.clear()
|
||
.append_pair(<span class="string">"foo"</span>, <span class="string">"bar & baz"</span>)
|
||
.append_pair(<span class="string">"saisons"</span>, <span class="string">"\u{00C9}t\u{00E9}+hiver"</span>);
|
||
<span class="macro">assert_eq!</span>(url.query(), <span class="prelude-val">Some</span>(<span class="string">"foo=bar+%26+baz&saisons=%C3%89t%C3%A9%2Bhiver"</span>));
|
||
<span class="macro">assert_eq!</span>(url.as_str(),
|
||
<span class="string">"https://example.net/?foo=bar+%26+baz&saisons=%C3%89t%C3%A9%2Bhiver#nav"</span>);</code></pre></div>
|
||
<p>Note: <code>url.query_pairs_mut().clear();</code> is equivalent to <code>url.set_query(Some(""))</code>,
|
||
not <code>url.set_query(None)</code>.</p>
|
||
<p>The state of <code>Url</code> is unspecified if this return value is leaked without being dropped.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_path" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1560">source</a><h4 class="code-header">pub fn <a href="#method.set_path" class="fnname">set_path</a>(&mut self, path: &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>)</h4></section></summary><div class="docblock"><p>Change this URL’s path.</p>
|
||
<h5 id="examples-27"><a href="#examples-27">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
url.set_path(<span class="string">"api/comments"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/api/comments"</span>);
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/api/comments"</span>);
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.com/api"</span>)<span class="question-mark">?</span>;
|
||
url.set_path(<span class="string">"data/report.csv"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/data/report.csv"</span>);
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/data/report.csv"</span>);
|
||
|
||
<span class="comment">// `set_path` percent-encodes the given string if it's not already percent-encoded.
|
||
</span><span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
url.set_path(<span class="string">"api/some comments"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/api/some%20comments"</span>);
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/api/some%20comments"</span>);
|
||
|
||
<span class="comment">// `set_path` will not double percent-encode the string if it's already percent-encoded.
|
||
</span><span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.com"</span>)<span class="question-mark">?</span>;
|
||
url.set_path(<span class="string">"api/some%20comments"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.com/api/some%20comments"</span>);
|
||
<span class="macro">assert_eq!</span>(url.path(), <span class="string">"/api/some%20comments"</span>);
|
||
</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.path_segments_mut" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1585">source</a><h4 class="code-header">pub fn <a href="#method.path_segments_mut" class="fnname">path_segments_mut</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://docs.rs/url/2.3.1/url/path_segments/struct.PathSegmentsMut.html" title="struct url::path_segments::PathSegmentsMut">PathSegmentsMut</a><'_>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Return an object with methods to manipulate this URL’s path segments.</p>
|
||
<p>Return <code>Err(())</code> if this URL is cannot-be-a-base.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_port" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1669">source</a><h4 class="code-header">pub fn <a href="#method.set_port" class="fnname">set_port</a>(&mut self, port: <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.u16.html">u16</a>>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Change this URL’s port number.</p>
|
||
<p>Note that default port numbers are not reflected in the serialization.</p>
|
||
<p>If this URL is cannot-be-a-base, does not have a host, or has the <code>file</code> scheme;
|
||
do nothing and return <code>Err</code>.</p>
|
||
<h5 id="examples-28"><a href="#examples-28">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"ssh://example.net:2048/"</span>)<span class="question-mark">?</span>;
|
||
|
||
url.set_port(<span class="prelude-val">Some</span>(<span class="number">4096</span>)).map_err(|<span class="kw">_</span>| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"ssh://example.net:4096/"</span>);
|
||
|
||
url.set_port(<span class="prelude-val">None</span>).map_err(|<span class="kw">_</span>| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"ssh://example.net/"</span>);</code></pre></div>
|
||
<p>Known default port numbers are not reflected:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.org/"</span>)<span class="question-mark">?</span>;
|
||
|
||
url.set_port(<span class="prelude-val">Some</span>(<span class="number">443</span>)).map_err(|<span class="kw">_</span>| <span class="string">"cannot be base"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert!</span>(url.port().is_none());</code></pre></div>
|
||
<p>Cannot set port for cannot-be-a-base URLs:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"mailto:rms@example.net"</span>)<span class="question-mark">?</span>;
|
||
|
||
<span class="kw">let </span>result = url.set_port(<span class="prelude-val">Some</span>(<span class="number">80</span>));
|
||
<span class="macro">assert!</span>(result.is_err());
|
||
|
||
<span class="kw">let </span>result = url.set_port(<span class="prelude-val">None</span>);
|
||
<span class="macro">assert!</span>(result.is_err());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_host" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1802">source</a><h4 class="code-header">pub fn <a href="#method.set_host" class="fnname">set_host</a>(&mut self, host: <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>, <a class="enum" href="https://docs.rs/url/2.3.1/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>></h4></section></summary><div class="docblock"><p>Change this URL’s host.</p>
|
||
<p>Removing the host (calling this with <code>None</code>)
|
||
will also remove any username, password, and port number.</p>
|
||
<h5 id="examples-29"><a href="#examples-29">Examples</a></h5>
|
||
<p>Change host:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_host(<span class="prelude-val">Some</span>(<span class="string">"rust-lang.org"</span>));
|
||
<span class="macro">assert!</span>(result.is_ok());
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://rust-lang.org/"</span>);</code></pre></div>
|
||
<p>Remove host:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"foo://example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_host(<span class="prelude-val">None</span>);
|
||
<span class="macro">assert!</span>(result.is_ok());
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"foo:/"</span>);</code></pre></div>
|
||
<p>Cannot remove host for ‘special’ schemes (e.g. <code>http</code>):</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_host(<span class="prelude-val">None</span>);
|
||
<span class="macro">assert!</span>(result.is_err());
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.net/"</span>);</code></pre></div>
|
||
<p>Cannot change or remove host for cannot-be-a-base URLs:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"mailto:rms@example.net"</span>)<span class="question-mark">?</span>;
|
||
|
||
<span class="kw">let </span>result = url.set_host(<span class="prelude-val">Some</span>(<span class="string">"rust-lang.org"</span>));
|
||
<span class="macro">assert!</span>(result.is_err());
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"mailto:rms@example.net"</span>);
|
||
|
||
<span class="kw">let </span>result = url.set_host(<span class="prelude-val">None</span>);
|
||
<span class="macro">assert!</span>(result.is_err());
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"mailto:rms@example.net"</span>);</code></pre></div>
|
||
<h5 id="errors-4"><a href="#errors-4">Errors</a></h5>
|
||
<p>If this URL is cannot-be-a-base or there is an error parsing the given <code>host</code>,
|
||
a <a href="enum.ParseError.html"><code>ParseError</code></a> variant will be returned.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_ip_host" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1947">source</a><h4 class="code-header">pub fn <a href="#method.set_ip_host" class="fnname">set_ip_host</a>(&mut self, address: <a class="enum" href="https://doc.rust-lang.org/1.66.1/std/net/ip_addr/enum.IpAddr.html" title="enum std::net::ip_addr::IpAddr">IpAddr</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Change this URL’s host to the given IP address.</p>
|
||
<p>If this URL is cannot-be-a-base, do nothing and return <code>Err</code>.</p>
|
||
<p>Compared to <code>Url::set_host</code>, this skips the host parser.</p>
|
||
<h5 id="examples-30"><a href="#examples-30">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Url, ParseError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"http://example.com"</span>)<span class="question-mark">?</span>;
|
||
url.set_ip_host(<span class="string">"127.0.0.1"</span>.parse().unwrap());
|
||
<span class="macro">assert_eq!</span>(url.host_str(), <span class="prelude-val">Some</span>(<span class="string">"127.0.0.1"</span>));
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"http://127.0.0.1/"</span>);</code></pre></div>
|
||
<p>Cannot change URL’s from mailto(cannot-be-base) to ip:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Url, ParseError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"mailto:rms@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_ip_host(<span class="string">"127.0.0.1"</span>.parse().unwrap());
|
||
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"mailto:rms@example.com"</span>);
|
||
<span class="macro">assert!</span>(result.is_err());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_password" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#1987">source</a><h4 class="code-header">pub fn <a href="#method.set_password" class="fnname">set_password</a>(&mut self, password: <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Change this URL’s password.</p>
|
||
<p>If this URL is cannot-be-a-base or does not have a host, do nothing and return <code>Err</code>.</p>
|
||
<h5 id="examples-31"><a href="#examples-31">Examples</a></h5>
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Url, ParseError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"mailto:rmz@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_password(<span class="prelude-val">Some</span>(<span class="string">"secret_password"</span>));
|
||
<span class="macro">assert!</span>(result.is_err());
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"ftp://user1:secret1@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_password(<span class="prelude-val">Some</span>(<span class="string">"secret_password"</span>));
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">Some</span>(<span class="string">"secret_password"</span>));
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"ftp://user2:@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_password(<span class="prelude-val">Some</span>(<span class="string">"secret2"</span>));
|
||
<span class="macro">assert!</span>(result.is_ok());
|
||
<span class="macro">assert_eq!</span>(url.password(), <span class="prelude-val">Some</span>(<span class="string">"secret2"</span>));</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_username" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2080">source</a><h4 class="code-header">pub fn <a href="#method.set_username" class="fnname">set_username</a>(&mut self, username: &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Change this URL’s username.</p>
|
||
<p>If this URL is cannot-be-a-base or does not have a host, do nothing and return <code>Err</code>.</p>
|
||
<h5 id="examples-32"><a href="#examples-32">Examples</a></h5>
|
||
<p>Cannot setup username from mailto(cannot-be-base)</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Url, ParseError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"mailto:rmz@example.com"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_username(<span class="string">"user1"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"mailto:rmz@example.com"</span>);
|
||
<span class="macro">assert!</span>(result.is_err());</code></pre></div>
|
||
<p>Setup username to user1</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::{Url, ParseError};
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"ftp://:secre1@example.com/"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_username(<span class="string">"user1"</span>);
|
||
<span class="macro">assert!</span>(result.is_ok());
|
||
<span class="macro">assert_eq!</span>(url.username(), <span class="string">"user1"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"ftp://user1:secre1@example.com/"</span>);</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.set_scheme" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2242">source</a><h4 class="code-header">pub fn <a href="#method.set_scheme" class="fnname">set_scheme</a>(&mut self, scheme: &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Change this URL’s scheme.</p>
|
||
<p>Do nothing and return <code>Err</code> under the following circumstances:</p>
|
||
<ul>
|
||
<li>If the new scheme is not in <code>[a-zA-Z][a-zA-Z0-9+.-]+</code></li>
|
||
<li>If this URL is cannot-be-a-base and the new scheme is one of
|
||
<code>http</code>, <code>https</code>, <code>ws</code>, <code>wss</code> or <code>ftp</code></li>
|
||
<li>If either the old or new scheme is <code>http</code>, <code>https</code>, <code>ws</code>,
|
||
<code>wss</code> or <code>ftp</code> and the other is not one of these</li>
|
||
<li>If the new scheme is <code>file</code> and this URL includes credentials
|
||
or has a non-null port</li>
|
||
<li>If this URL’s scheme is <code>file</code> and its host is empty or null</li>
|
||
</ul>
|
||
<p>See also <a href="https://url.spec.whatwg.org/#scheme-state">the URL specification’s section on legal scheme state
|
||
overrides</a>.</p>
|
||
<h5 id="examples-33"><a href="#examples-33">Examples</a></h5>
|
||
<p>Change the URL’s scheme from <code>https</code> to <code>http</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_scheme(<span class="string">"http"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"http://example.net/"</span>);
|
||
<span class="macro">assert!</span>(result.is_ok());</code></pre></div>
|
||
<p>Change the URL’s scheme from <code>foo</code> to <code>bar</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"foo://example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_scheme(<span class="string">"bar"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"bar://example.net"</span>);
|
||
<span class="macro">assert!</span>(result.is_ok());</code></pre></div>
|
||
<p>Cannot change URL’s scheme from <code>https</code> to <code>foõ</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"https://example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_scheme(<span class="string">"foõ"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"https://example.net/"</span>);
|
||
<span class="macro">assert!</span>(result.is_err());</code></pre></div>
|
||
<p>Cannot change URL’s scheme from <code>mailto</code> (cannot-be-a-base) to <code>https</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"mailto:rms@example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_scheme(<span class="string">"https"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"mailto:rms@example.net"</span>);
|
||
<span class="macro">assert!</span>(result.is_err());</code></pre></div>
|
||
<p>Cannot change the URL’s scheme from <code>foo</code> to <code>https</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"foo://example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_scheme(<span class="string">"https"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"foo://example.net"</span>);
|
||
<span class="macro">assert!</span>(result.is_err());</code></pre></div>
|
||
<p>Cannot change the URL’s scheme from <code>http</code> to <code>foo</code>:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>url = Url::parse(<span class="string">"http://example.net"</span>)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>result = url.set_scheme(<span class="string">"foo"</span>);
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"http://example.net/"</span>);
|
||
<span class="macro">assert!</span>(result.is_err());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_file_path" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2322">source</a><h4 class="code-header">pub fn <a href="#method.from_file_path" class="fnname">from_file_path</a><P>(path: P) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>><span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>,</span></h4></section></summary><div class="docblock"><p>Convert a file name as <code>std::path::Path</code> into an URL in the <code>file</code> scheme.</p>
|
||
<p>This returns <code>Err</code> if the given path is not absolute or,
|
||
on Windows, if the prefix is not a disk prefix (e.g. <code>C:</code>) or a UNC prefix (<code>\\</code>).</p>
|
||
<h5 id="examples-34"><a href="#examples-34">Examples</a></h5>
|
||
<p>On Unix-like platforms:</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>url::Url;
|
||
|
||
<span class="kw">let </span>url = Url::from_file_path(<span class="string">"/tmp/foo.txt"</span>)<span class="question-mark">?</span>;
|
||
<span class="macro">assert_eq!</span>(url.as_str(), <span class="string">"file:///tmp/foo.txt"</span>);
|
||
|
||
<span class="kw">let </span>url = Url::from_file_path(<span class="string">"../foo.txt"</span>);
|
||
<span class="macro">assert!</span>(url.is_err());
|
||
|
||
<span class="kw">let </span>url = Url::from_file_path(<span class="string">"https://google.com/"</span>);
|
||
<span class="macro">assert!</span>(url.is_err());</code></pre></div>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_directory_path" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2359">source</a><h4 class="code-header">pub fn <a href="#method.from_directory_path" class="fnname">from_directory_path</a><P>(path: P) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>><span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>,</span></h4></section></summary><div class="docblock"><p>Convert a directory name as <code>std::path::Path</code> into an URL in the <code>file</code> scheme.</p>
|
||
<p>This returns <code>Err</code> if the given path is not absolute or,
|
||
on Windows, if the prefix is not a disk prefix (e.g. <code>C:</code>) or a UNC prefix (<code>\\</code>).</p>
|
||
<p>Compared to <code>from_file_path</code>, this ensure that URL’s the path has a trailing slash
|
||
so that the entire path is considered when using this URL as a base URL.</p>
|
||
<p>For example:</p>
|
||
<ul>
|
||
<li><code>"index.html"</code> parsed with <code>Url::from_directory_path(Path::new("/var/www"))</code>
|
||
as the base URL is <code>file:///var/www/index.html</code></li>
|
||
<li><code>"index.html"</code> parsed with <code>Url::from_file_path(Path::new("/var/www"))</code>
|
||
as the base URL is <code>file:///var/index.html</code>, which might not be what was intended.</li>
|
||
</ul>
|
||
<p>Note that <code>std::path</code> does not consider trailing slashes significant
|
||
and usually does not include them (e.g. in <code>Path::parent()</code>).</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.serialize_internal" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2375-2377">source</a><h4 class="code-header">pub fn <a href="#method.serialize_internal" class="fnname">serialize_internal</a><S>(<br> &self,<br> serializer: S<br>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<S as <a class="trait" href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>>::<a class="associatedtype" href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, <S as <a class="trait" href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>>::<a class="associatedtype" href="https://docs.rs/serde/1.0.152/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.152/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>,</span></h4></section></summary><div class="docblock"><p>Serialize with Serde using the internal representation of the <code>Url</code> struct.</p>
|
||
<p>The corresponding <code>deserialize_internal</code> method sacrifices some invariant-checking
|
||
for speed, compared to the <code>Deserialize</code> trait impl.</p>
|
||
<p>This method is only available if the <code>serde</code> Cargo feature is enabled.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deserialize_internal" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2417-2419">source</a><h4 class="code-header">pub fn <a href="#method.deserialize_internal" class="fnname">deserialize_internal</a><'de, D>(<br> deserializer: D<br>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <D as <a class="trait" href="https://docs.rs/serde/1.0.152/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>>::<a class="associatedtype" href="https://docs.rs/serde/1.0.152/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.152/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>,</span></h4></section></summary><div class="docblock"><p>Serialize with Serde using the internal representation of the <code>Url</code> struct.</p>
|
||
<p>The corresponding <code>deserialize_internal</code> method sacrifices some invariant-checking
|
||
for speed, compared to the <code>Deserialize</code> trait impl.</p>
|
||
<p>This method is only available if the <code>serde</code> Cargo feature is enabled.</p>
|
||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_file_path" class="method has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2476">source</a><h4 class="code-header">pub fn <a href="#method.to_file_path" class="fnname">to_file_path</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>, <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Assuming the URL is in the <code>file</code> scheme or similar,
|
||
convert its path to an absolute <code>std::path::Path</code>.</p>
|
||
<p><strong>Note:</strong> This does not actually check the URL’s <code>scheme</code>,
|
||
and may give nonsensical results for other schemes.
|
||
It is the user’s responsibility to check the URL’s scheme before calling this.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>path = url.to_file_path();</code></pre></div>
|
||
<p>Returns <code>Err</code> if the host is neither empty nor <code>"localhost"</code> (except on Windows, where
|
||
<code>file:</code> URLs may have a non-local host),
|
||
or if <code>Path::new_opt()</code> returns <code>None</code>.
|
||
(That is, if the percent-decoded path contains a NUL byte or,
|
||
for a Windows path, is not UTF-8.)</p>
|
||
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-AsRef%3Cstr%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2598">source</a><a href="#impl-AsRef%3Cstr%3E-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>Return the serialization of this URL.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.as_ref" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2600">source</a><a href="#method.as_ref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.AsRef.html#tymethod.as_ref" class="fnname">as_ref</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#169">source</a><a href="#impl-Clone-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#169">source</a><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.66.1/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/clone.rs.html#132-134">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/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/1.66.1/std/primitive.reference.html">&</a>Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.66.1/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2541">source</a><a href="#impl-Debug-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>Debug the serialization of this URL.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2543">source</a><a href="#method.fmt-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, formatter: &mut <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.66.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Deserialize%3C%27de%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2647">source</a><a href="#impl-Deserialize%3C%27de%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<'de> <a class="trait" href="https://docs.rs/serde/1.0.152/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>Deserializes this URL from a <code>serde</code> stream.</p>
|
||
<p>This implementation is only available if the <code>serde</code> Cargo feature is enabled.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deserialize" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2648-2650">source</a><a href="#method.deserialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.152/serde/de/trait.Deserialize.html#tymethod.deserialize" class="fnname">deserialize</a><D>(<br> deserializer: D<br>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <D as <a class="trait" href="https://docs.rs/serde/1.0.152/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>>::<a class="associatedtype" href="https://docs.rs/serde/1.0.152/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.152/serde/de/trait.Deserializer.html" title="trait serde::de::Deserializer">Deserializer</a><'de>,</span></h4></section></summary><div class='docblock'>Deserialize this value from the given Serde deserializer. <a href="https://docs.rs/serde/1.0.152/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Display-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2526">source</a><a href="#impl-Display-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>Display the serialization of this URL.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2528">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&self, formatter: &mut <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/fmt/struct.Error.html" title="struct core::fmt::Error">Error</a>></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.66.1/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-From%3CUrl%3E-for-PartialValue" class="impl has-srclink"><a class="srclink rightside" href="../../src/kanidmd_lib/value.rs.html#374-378">source</a><a href="#impl-From%3CUrl%3E-for-PartialValue" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>> for <a class="enum" href="../value/enum.PartialValue.html" title="enum kanidmd_lib::value::PartialValue">PartialValue</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/kanidmd_lib/value.rs.html#375-377">source</a><a href="#method.from-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(i: <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-From%3CUrl%3E-for-String" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2534">source</a><a href="#impl-From%3CUrl%3E-for-String" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>> for <a class="struct" href="https://doc.rust-lang.org/1.66.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h3></section></summary><div class="docblock"><p>String conversion.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2535">source</a><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(value: <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>) -> <a class="struct" href="https://doc.rust-lang.org/1.66.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-From%3CUrl%3E-for-Value" class="impl has-srclink"><a class="srclink rightside" href="../../src/kanidmd_lib/value.rs.html#876-880">source</a><a href="#impl-From%3CUrl%3E-for-Value" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>> for <a class="enum" href="../value/enum.Value.html" title="enum kanidmd_lib::value::Value">Value</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/kanidmd_lib/value.rs.html#877-879">source</a><a href="#method.from-2" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(i: <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>) -> Self</h4></section></summary><div class='docblock'>Converts to this type from the input type.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-FromStr-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2508">source</a><a href="#impl-FromStr-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>Parse a string as an URL, without a base URL or encoding override.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Err" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Err" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/core/str/traits/trait.FromStr.html#associatedtype.Err" class="associatedtype">Err</a> = <a class="enum" href="https://docs.rs/url/2.3.1/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a></h4></section></summary><div class='docblock'>The associated error which can be returned from parsing.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_str" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2512">source</a><a href="#method.from_str" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fnname">from_str</a>(input: &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <a class="enum" href="https://docs.rs/url/2.3.1/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a>></h4></section></summary><div class='docblock'>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/1.66.1/core/str/traits/trait.FromStr.html#tymethod.from_str">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Hash-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2587">source</a><a href="#impl-Hash-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>URLs hash like their serialization.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.hash" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2589-2591">source</a><a href="#method.hash" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a><H>(&self, state: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&mut </a>H)<span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,</span></h4></section></summary><div class='docblock'>Feeds this value into the given <a href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.hash_slice" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/hash/mod.rs.html#237-239">source</a></span><a href="#method.hash_slice" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a><H>(data: &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.slice.html">[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&mut </a>H)<span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h4></section></summary><div class='docblock'>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Index%3CRange%3CPosition%3E%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/slicing.rs.html#33">source</a><a href="#impl-Index%3CRange%3CPosition%3E%3E-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a><<a class="enum" href="https://docs.rs/url/2.3.1/url/slicing/enum.Position.html" title="enum url::slicing::Position">Position</a>>> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-2" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-2" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.index-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/slicing.rs.html#35">source</a><a href="#method.index-2" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#tymethod.index" class="fnname">index</a>(&self, range: <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a><<a class="enum" href="https://docs.rs/url/2.3.1/url/slicing/enum.Position.html" title="enum url::slicing::Position">Position</a>>) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Index%3CRangeFrom%3CPosition%3E%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/slicing.rs.html#19">source</a><a href="#impl-Index%3CRangeFrom%3CPosition%3E%3E-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/core/ops/range/struct.RangeFrom.html" title="struct core::ops::range::RangeFrom">RangeFrom</a><<a class="enum" href="https://docs.rs/url/2.3.1/url/slicing/enum.Position.html" title="enum url::slicing::Position">Position</a>>> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.index-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/slicing.rs.html#21">source</a><a href="#method.index-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#tymethod.index" class="fnname">index</a>(&self, range: <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/ops/range/struct.RangeFrom.html" title="struct core::ops::range::RangeFrom">RangeFrom</a><<a class="enum" href="https://docs.rs/url/2.3.1/url/slicing/enum.Position.html" title="enum url::slicing::Position">Position</a>>) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Index%3CRangeFull%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/slicing.rs.html#12">source</a><a href="#impl-Index%3CRangeFull%3E-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/core/ops/range/struct.RangeFull.html" title="struct core::ops::range::RangeFull">RangeFull</a>> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.index" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/slicing.rs.html#14">source</a><a href="#method.index" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#tymethod.index" class="fnname">index</a>(&self, <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/ops/range/struct.RangeFull.html" title="struct core::ops::range::RangeFull">RangeFull</a>) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Index%3CRangeTo%3CPosition%3E%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/slicing.rs.html#26">source</a><a href="#impl-Index%3CRangeTo%3CPosition%3E%3E-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a><<a class="struct" href="https://doc.rust-lang.org/1.66.1/core/ops/range/struct.RangeTo.html" title="struct core::ops::range::RangeTo">RangeTo</a><<a class="enum" href="https://docs.rs/url/2.3.1/url/slicing/enum.Position.html" title="enum url::slicing::Position">Position</a>>> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-3" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-3" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.index-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/slicing.rs.html#28">source</a><a href="#method.index-3" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#tymethod.index" class="fnname">index</a>(&self, range: <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/ops/range/struct.RangeTo.html" title="struct core::ops::range::RangeTo">RangeTo</a><<a class="enum" href="https://docs.rs/url/2.3.1/url/slicing/enum.Position.html" title="enum url::slicing::Position">Position</a>>) -> &<a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.66.1/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Ord-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2571">source</a><a href="#impl-Ord-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>URLs compare like their serialization.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2573">source</a><a href="#method.cmp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html#tymethod.cmp" class="fnname">cmp</a>(&self, other: &<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><div class='docblock'>This method returns an <a href="https://doc.rust-lang.org/1.66.1/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.max" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/cmp.rs.html#795-798">source</a></span><a href="#method.max" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html#method.max" class="fnname">max</a>(self, other: Self) -> Self<span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h4></section></summary><div class='docblock'>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.min" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/cmp.rs.html#822-825">source</a></span><a href="#method.min" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html#method.min" class="fnname">min</a>(self, other: Self) -> Self<span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h4></section></summary><div class='docblock'>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clamp" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.50.0">1.50.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/cmp.rs.html#854-858">source</a></span><a href="#method.clamp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html#method.clamp" class="fnname">clamp</a>(self, min: Self, max: Self) -> Self<span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Self>,</span></h4></section></summary><div class='docblock'>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CUrl%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2563">source</a><a href="#impl-PartialEq%3CUrl%3E-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>URLs compare like their serialization.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2565">source</a><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&self, other: &<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>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/1.66.1/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/cmp.rs.html#227">source</a></span><a href="#method.ne" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
|
||
sufficient, and should not be overridden without very good reason. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialEq.html#method.ne">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialOrd%3CUrl%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2579">source</a><a href="#impl-PartialOrd%3CUrl%3E-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>URLs compare like their serialization.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2581">source</a><a href="#method.partial_cmp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp" class="fnname">partial_cmp</a>(&self, other: &<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="https://doc.rust-lang.org/1.66.1/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>></h4></section></summary><div class='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/cmp.rs.html#1119">source</a></span><a href="#method.lt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#method.lt" class="fnname">lt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.le" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/cmp.rs.html#1138">source</a></span><a href="#method.le" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#method.le" class="fnname">le</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code>
|
||
operator. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/cmp.rs.html#1156">source</a></span><a href="#method.gt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#method.gt" class="fnname">gt</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/cmp.rs.html#1175">source</a></span><a href="#method.ge" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#method.ge" class="fnname">ge</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code>
|
||
operator. <a href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Serialize-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2634">source</a><a href="#impl-Serialize-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="docblock"><p>Serializes this URL into a <code>serde</code> stream.</p>
|
||
<p>This implementation is only available if the <code>serde</code> Cargo feature is enabled.</p>
|
||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.serialize" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2635-2637">source</a><a href="#method.serialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serialize.html#tymethod.serialize" class="fnname">serialize</a><S>(<br> &self,<br> serializer: S<br>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<S as <a class="trait" href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>>::<a class="associatedtype" href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serializer.html#associatedtype.Ok" title="type serde::ser::Serializer::Ok">Ok</a>, <S as <a class="trait" href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>>::<a class="associatedtype" href="https://docs.rs/serde/1.0.152/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.152/serde/ser/trait.Serializer.html" title="trait serde::ser::Serializer">Serializer</a>,</span></h4></section></summary><div class='docblock'>Serialize this value into the given Serde serializer. <a href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-ToListener%3CState%3E-for-Url" class="impl has-srclink"><a href="#impl-ToListener%3CState%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<State> ToListener<State> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a><span class="where fmt-newline">where<br> State: 'static + <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Listener" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Listener" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Listener</a> = ParsedListener<State></h4></section></summary><div class='docblock'>What listener are we converting into?</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_listener" class="method trait-impl has-srclink"><a href="#method.to_listener" class="anchor"></a><h4 class="code-header">fn <a class="fnname">to_listener</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a> as ToListener<State>>::Listener, <a class="struct" href="https://doc.rust-lang.org/1.66.1/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></h4></section></summary><div class='docblock'>Transform self into a
|
||
<a href="crate::listener::Listener"><code>Listener</code></a>. Unless self is
|
||
already bound/connected to the underlying io, converting to a
|
||
listener does not initiate a connection. An Err return
|
||
indicates an unsuccessful conversion to a listener, not an
|
||
unsuccessful bind attempt. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-TryFrom%3C%26%27a%20str%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2517">source</a><a href="#impl-TryFrom%3C%26%27a%20str%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&'a <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://docs.rs/url/2.3.1/url/parser/enum.ParseError.html" title="enum url::parser::ParseError">ParseError</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2520">source</a><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(s: &'a <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a>, <<a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a> as <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><&'a <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.str.html">str</a>>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><section id="impl-Eq-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/url/2.3.1/src/url/lib.rs.html#2560">source</a><a href="#impl-Eq-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section><div class="docblock"><p>URLs compare like their serialization.</p>
|
||
</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"><section id="impl-RefUnwindSafe-for-Url" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section><section id="impl-Send-for-Url" class="impl has-srclink"><a href="#impl-Send-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section><section id="impl-Sync-for-Url" class="impl has-srclink"><a href="#impl-Sync-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section><section id="impl-Unpin-for-Url" class="impl has-srclink"><a href="#impl-Unpin-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section><section id="impl-UnwindSafe-for-Url" class="impl has-srclink"><a href="#impl-UnwindSafe-for-Url" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Url.html" title="struct kanidmd_lib::prelude::Url">Url</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/core/any.rs.html#200">source</a><a href="#impl-Any-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.66.1/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/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/core/any.rs.html#201">source</a><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.66.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.66.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsTaggedExplicit%3C%27a%3E-for-Url" class="impl has-srclink"><a href="#impl-AsTaggedExplicit%3C%27a%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<'a, T> AsTaggedExplicit<'a> for T<span class="where fmt-newline">where<br> T: 'a,</span></h3></section></summary><div class="impl-items"><section id="method.explicit" class="method trait-impl has-srclink"><a href="#method.explicit" class="anchor"></a><h4 class="code-header">fn <a class="fnname">explicit</a>(self, class: Class, tag: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.u32.html">u32</a>) -> TaggedParser<'a, Explicit, Self></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-AsTaggedImplicit%3C%27a%3E-for-Url" class="impl has-srclink"><a href="#impl-AsTaggedImplicit%3C%27a%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<'a, T> AsTaggedImplicit<'a> for T<span class="where fmt-newline">where<br> T: 'a,</span></h3></section></summary><div class="impl-items"><section id="method.implicit" class="method trait-impl has-srclink"><a href="#method.implicit" class="anchor"></a><h4 class="code-header">fn <a class="fnname">implicit</a>(<br> self,<br> class: Class,<br> constructed: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.bool.html">bool</a>,<br> tag: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.u32.html">u32</a><br>) -> TaggedParser<'a, Implicit, Self></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/core/borrow.rs.html#211">source</a><a href="#impl-Borrow%3CT%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.66.1/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/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/borrow.rs.html#213">source</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.66.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/core/borrow.rs.html#220">source</a><a href="#impl-BorrowMut%3CT%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.66.1/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/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/borrow.rs.html#221">source</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.66.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-CallHasher-for-Url" class="impl has-srclink"><a href="#impl-CallHasher-for-Url" class="anchor"></a><h3 class="code-header">impl<T> CallHasher for T<span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><section id="method.get_hash" class="method trait-impl has-srclink"><a href="#method.get_hash" class="anchor"></a><h4 class="code-header">fn <a class="fnname">get_hash</a><H, B>(value: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&</a>H, build_hasher: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&</a>B) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.u64.html">u64</a><span class="where fmt-newline">where<br> H: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,<br> B: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>,</span></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-DynClone-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/dyn_clone/1.0.10/src/dyn_clone/lib.rs.html#189">source</a><a href="#impl-DynClone-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/dyn_clone/1.0.10/dyn_clone/trait.DynClone.html" title="trait dyn_clone::DynClone">DynClone</a> for T<span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span></h3></section></summary><div class="impl-items"><section id="method.__clone_box" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/dyn_clone/1.0.10/src/dyn_clone/lib.rs.html#193">source</a><a href="#method.__clone_box" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/dyn_clone/1.0.10/dyn_clone/trait.DynClone.html#tymethod.__clone_box" class="fnname">__clone_box</a>(&self, Private) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.unit.html">()</a></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/core/convert/mod.rs.html#733">source</a><a href="#impl-From%3CT%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from-3" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/convert/mod.rs.html#736">source</a></span><a href="#method.from-3" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Instrument-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#276">source</a><a href="#impl-Instrument-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html" title="trait tracing::instrument::Instrument">Instrument</a> for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.instrument" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#82">source</a><a href="#method.instrument" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument" class="fnname">instrument</a>(self, span: <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title="struct tracing::span::Span">Span</a>) -> <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><div class='docblock'>Instruments this type with the provided <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title="Span"><code>Span</code></a>, returning an
|
||
<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.in_current_span" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#121">source</a><a href="#method.in_current_span" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span" class="fnname">in_current_span</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html" title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><div class='docblock'>Instruments this type with the <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html#method.current">current</a> <a href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html"><code>Span</code></a>, returning an
|
||
<code>Instrumented</code> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/core/convert/mod.rs.html#717">source</a><a href="#impl-Into%3CU%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.66.1/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/1.66.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/convert/mod.rs.html#725">source</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.From.html" title="From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Pointable-for-Url" class="impl has-srclink"><a href="#impl-Pointable-for-Url" class="anchor"></a><h3 class="code-header">impl<T> Pointable for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedconstant.ALIGN" class="associatedconstant trait-impl has-srclink"><a href="#associatedconstant.ALIGN" class="anchor"></a><h4 class="code-header">const <a class="constant">ALIGN</a>: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.usize.html">usize</a> = mem::align_of::<T>()</h4></section></summary><div class='docblock'>The alignment of pointer.</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Init" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Init" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Init</a> = T</h4></section></summary><div class='docblock'>The type for initializers.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.init" class="method trait-impl has-srclink"><a href="#method.init" class="anchor"></a><h4 class="code-header">unsafe fn <a class="fnname">init</a>(init: <T as Pointable>::Init) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Initializes a with the given initializer. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl has-srclink"><a href="#method.deref" class="anchor"></a><h4 class="code-header">unsafe fn <a class="fnname">deref</a><'a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&'a </a>T</h4></section></summary><div class='docblock'>Dereferences the given pointer. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deref_mut" class="method trait-impl has-srclink"><a href="#method.deref_mut" class="anchor"></a><h4 class="code-header">unsafe fn <a class="fnname">deref_mut</a><'a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&'a mut </a>T</h4></section></summary><div class='docblock'>Mutably dereferences the given pointer. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.drop" class="method trait-impl has-srclink"><a href="#method.drop" class="anchor"></a><h4 class="code-header">unsafe fn <a class="fnname">drop</a>(ptr: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.usize.html">usize</a>)</h4></section></summary><div class='docblock'>Drops the object pointed to by the given pointer. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Same%3CT%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/typenum/1.15.0/src/typenum/type_operators.rs.html#34">source</a><a href="#impl-Same%3CT%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/typenum/1.15.0/typenum/type_operators/trait.Same.html" title="trait typenum::type_operators::Same">Same</a><T> for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-4" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-4" class="anchor"></a><h4 class="code-header">type <a href="https://docs.rs/typenum/1.15.0/typenum/type_operators/trait.Same.html#associatedtype.Output" class="associatedtype">Output</a> = T</h4></section></summary><div class='docblock'>Should always be <code>Self</code></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Serialize-for-Url-1" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/erased-serde/0.3.23/src/erased_serde/ser.rs.html#238">source</a><a href="#impl-Serialize-for-Url-1" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/erased-serde/0.3.23/erased_serde/ser/trait.Serialize.html" title="trait erased_serde::ser::Serialize">Serialize</a> for T<span class="where fmt-newline">where<br> T: <a class="trait" href="https://docs.rs/serde/1.0.152/serde/ser/trait.Serialize.html" title="trait serde::ser::Serialize">Serialize</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><section id="method.erased_serialize" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/erased-serde/0.3.23/src/erased_serde/ser.rs.html#242">source</a><a href="#method.erased_serialize" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/erased-serde/0.3.23/erased_serde/ser/trait.Serialize.html#tymethod.erased_serialize" class="fnname">erased_serialize</a>(&self, serializer: &mut dyn <a class="trait" href="https://docs.rs/erased-serde/0.3.23/erased_serde/ser/trait.Serializer.html" title="trait erased_serde::ser::Serializer">Serializer</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Ok, <a class="struct" href="https://docs.rs/erased-serde/0.3.23/erased_serde/error/struct.Error.html" title="struct erased_serde::error::Error">Error</a>></h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/alloc/borrow.rs.html#82">source</a><a href="#impl-ToOwned-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.66.1/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/1.66.1/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/alloc/borrow.rs.html#87">source</a><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.66.1/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/alloc/borrow.rs.html#91">source</a><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.66.1/std/primitive.reference.html">&mut </a>T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.66.1/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToString-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/alloc/string.rs.html#2526">source</a><a href="#impl-ToString-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.66.1/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/1.66.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.66.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_string" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/alloc/string.rs.html#2532">source</a><a href="#method.to_string" class="anchor"></a><h4 class="code-header">default fn <a href="https://doc.rust-lang.org/1.66.1/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.66.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class='docblock'>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/1.66.1/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/core/convert/mod.rs.html#775">source</a><a href="#impl-TryFrom%3CU%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.66.1/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/1.66.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from-1" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/convert/mod.rs.html#781">source</a></span><a href="#method.try_from-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/1.66.1/src/core/convert/mod.rs.html#760">source</a><a href="#impl-TryInto%3CU%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.66.1/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/1.66.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-2" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-2" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.66.1/src/core/convert/mod.rs.html#766">source</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.66.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-VZip%3CV%3E-for-Url" class="impl has-srclink"><a href="#impl-VZip%3CV%3E-for-Url" class="anchor"></a><h3 class="code-header">impl<V, T> VZip<V> for T<span class="where fmt-newline">where<br> V: MultiLane<T>,</span></h3></section></summary><div class="impl-items"><section id="method.vzip" class="method trait-impl has-srclink"><a href="#method.vzip" class="anchor"></a><h4 class="code-header">fn <a class="fnname">vzip</a>(self) -> V</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-WithSubscriber-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#334">source</a><a href="#impl-WithSubscriber-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html" title="trait tracing::instrument::WithSubscriber">WithSubscriber</a> for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_subscriber" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#169-171">source</a><a href="#method.with_subscriber" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber" class="fnname">with_subscriber</a><S>(self, subscriber: S) -> <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self><span class="where fmt-newline">where<br> S: <a class="trait" href="https://doc.rust-lang.org/1.66.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://docs.rs/tracing-core/0.1.22/tracing_core/dispatcher/struct.Dispatch.html" title="struct tracing_core::dispatcher::Dispatch">Dispatch</a>>,</span></h4></section></summary><div class='docblock'>Attaches the provided <a href="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html"><code>Subscriber</code></a> to this type, returning a
|
||
<a href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="WithDispatch"><code>WithDispatch</code></a> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_current_subscriber" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#221">source</a><a href="#method.with_current_subscriber" class="anchor"></a><h4 class="code-header">fn <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber" class="fnname">with_current_subscriber</a>(self) -> <a class="struct" href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><div class='docblock'>Attaches the current <a href="https://docs.rs/tracing/0.1.37/tracing/dispatcher/index.html#setting-the-default-subscriber">default</a> <a href="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html"><code>Subscriber</code></a> to this type, returning a
|
||
<a href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title="WithDispatch"><code>WithDispatch</code></a> wrapper. <a href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber">Read more</a></div></details></div></details><section id="impl-DeserializeOwned-for-Url" class="impl has-srclink"><a class="srclink rightside" href="https://docs.rs/serde/1.0.152/src/serde/de/mod.rs.html#604">source</a><a href="#impl-DeserializeOwned-for-Url" class="anchor"></a><h3 class="code-header">impl<T> <a class="trait" href="https://docs.rs/serde/1.0.152/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T<span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="https://docs.rs/serde/1.0.152/serde/de/trait.Deserialize.html" title="trait serde::de::Deserialize">Deserialize</a><'de>,</span></h3></section></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="kanidmd_lib" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.1 (90743e729 2023-01-10)" ></div></body></html> |