Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 0c2243f8a1696816431e7210e991fa52 > files > 16425

rust-doc-1.35.0-1.mga7.armv7hl.rpm

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `PathBuf` struct in crate `std`."><meta name="keywords" content="rust, rustlang, rust-lang, PathBuf"><title>std::path::PathBuf - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize1.35.0.css"><link rel="stylesheet" type="text/css" href="../../rustdoc1.35.0.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark1.35.0.css"><link rel="stylesheet" type="text/css" href="../../light1.35.0.css" id="themeStyle"><script src="../../storage1.35.0.js"></script><noscript><link rel="stylesheet" href="../../noscript1.35.0.css"></noscript><link rel="shortcut icon" href="../../favicon1.35.0.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow1.35.0.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../std/index.html'><img src='../../rust-logo1.35.0.png' alt='logo' width='100'></a><p class='location'>Struct PathBuf</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.as_path">as_path</a><a href="#method.capacity">capacity</a><a href="#method.clear">clear</a><a href="#method.into_boxed_path">into_boxed_path</a><a href="#method.into_os_string">into_os_string</a><a href="#method.new">new</a><a href="#method.pop">pop</a><a href="#method.push">push</a><a href="#method.reserve">reserve</a><a href="#method.reserve_exact">reserve_exact</a><a href="#method.set_extension">set_extension</a><a href="#method.set_file_name">set_file_name</a><a href="#method.shrink_to">shrink_to</a><a href="#method.shrink_to_fit">shrink_to_fit</a><a href="#method.with_capacity">with_capacity</a></div><a class="sidebar-title" href="#deref-methods">Methods from Deref&lt;Target=Path&gt;</a><div class="sidebar-links"><a href="#method.ancestors">ancestors</a><a href="#method.as_os_str">as_os_str</a><a href="#method.canonicalize">canonicalize</a><a href="#method.components">components</a><a href="#method.display">display</a><a href="#method.ends_with">ends_with</a><a href="#method.exists">exists</a><a href="#method.extension">extension</a><a href="#method.file_name">file_name</a><a href="#method.file_stem">file_stem</a><a href="#method.has_root">has_root</a><a href="#method.is_absolute">is_absolute</a><a href="#method.is_dir">is_dir</a><a href="#method.is_file">is_file</a><a href="#method.is_relative">is_relative</a><a href="#method.iter">iter</a><a href="#method.join">join</a><a href="#method.metadata">metadata</a><a href="#method.parent">parent</a><a href="#method.read_dir">read_dir</a><a href="#method.read_link">read_link</a><a href="#method.starts_with">starts_with</a><a href="#method.strip_prefix">strip_prefix</a><a href="#method.symlink_metadata">symlink_metadata</a><a href="#method.to_path_buf">to_path_buf</a><a href="#method.to_str">to_str</a><a href="#method.to_string_lossy">to_string_lossy</a><a href="#method.with_extension">with_extension</a><a href="#method.with_file_name">with_file_name</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-AsRef%3COsStr%3E">AsRef&lt;OsStr&gt;</a><a href="#impl-AsRef%3CPath%3E">AsRef&lt;Path&gt;</a><a href="#impl-Borrow%3CPath%3E">Borrow&lt;Path&gt;</a><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Deref">Deref</a><a href="#impl-Eq">Eq</a><a href="#impl-Extend%3CP%3E">Extend&lt;P&gt;</a><a href="#impl-From%3C%26%27_%20T%3E">From&lt;&amp;&#39;_ T&gt;</a><a href="#impl-From%3C%26%27a%20PathBuf%3E">From&lt;&amp;&#39;a PathBuf&gt;</a><a href="#impl-From%3CBox%3CPath%3E%3E">From&lt;Box&lt;Path&gt;&gt;</a><a href="#impl-From%3CCow%3C%27a%2C%20Path%3E%3E">From&lt;Cow&lt;&#39;a, Path&gt;&gt;</a><a href="#impl-From%3COsString%3E">From&lt;OsString&gt;</a><a href="#impl-From%3CPathBuf%3E">From&lt;PathBuf&gt;</a><a href="#impl-From%3CString%3E">From&lt;String&gt;</a><a href="#impl-FromIterator%3CP%3E">FromIterator&lt;P&gt;</a><a href="#impl-FromStr">FromStr</a><a href="#impl-Hash">Hash</a><a href="#impl-IntoIterator">IntoIterator</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3C%26%27a%20OsStr%3E">PartialEq&lt;&amp;&#39;a OsStr&gt;</a><a href="#impl-PartialEq%3C%26%27a%20Path%3E">PartialEq&lt;&amp;&#39;a Path&gt;</a><a href="#impl-PartialEq%3CCow%3C%27a%2C%20OsStr%3E%3E">PartialEq&lt;Cow&lt;&#39;a, OsStr&gt;&gt;</a><a href="#impl-PartialEq%3CCow%3C%27a%2C%20Path%3E%3E">PartialEq&lt;Cow&lt;&#39;a, Path&gt;&gt;</a><a href="#impl-PartialEq%3COsStr%3E">PartialEq&lt;OsStr&gt;</a><a href="#impl-PartialEq%3COsString%3E">PartialEq&lt;OsString&gt;</a><a href="#impl-PartialEq%3CPath%3E">PartialEq&lt;Path&gt;</a><a href="#impl-PartialEq%3CPathBuf%3E">PartialEq&lt;PathBuf&gt;</a><a href="#impl-PartialOrd%3C%26%27a%20OsStr%3E">PartialOrd&lt;&amp;&#39;a OsStr&gt;</a><a href="#impl-PartialOrd%3C%26%27a%20Path%3E">PartialOrd&lt;&amp;&#39;a Path&gt;</a><a href="#impl-PartialOrd%3CCow%3C%27a%2C%20OsStr%3E%3E">PartialOrd&lt;Cow&lt;&#39;a, OsStr&gt;&gt;</a><a href="#impl-PartialOrd%3CCow%3C%27a%2C%20Path%3E%3E">PartialOrd&lt;Cow&lt;&#39;a, Path&gt;&gt;</a><a href="#impl-PartialOrd%3COsStr%3E">PartialOrd&lt;OsStr&gt;</a><a href="#impl-PartialOrd%3COsString%3E">PartialOrd&lt;OsString&gt;</a><a href="#impl-PartialOrd%3CPath%3E">PartialOrd&lt;Path&gt;</a><a href="#impl-PartialOrd%3CPathBuf%3E">PartialOrd&lt;PathBuf&gt;</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow">Borrow</a><a href="#impl-BorrowMut">BorrowMut</a><a href="#impl-From">From</a><a href="#impl-Into">Into</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom">TryFrom</a><a href="#impl-TryInto">TryInto</a></div></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>path</a></p><script>window.sidebarCurrent = {name: 'PathBuf', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush1.35.0.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme1.35.0.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel1.35.0.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/std/path.rs.html#1124-1126' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>std</a>::<wbr><a href='index.html'>path</a>::<wbr><a class="struct" href=''>PathBuf</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct PathBuf { /* fields omitted */ }</pre></div><div class='docblock'><p>An owned, mutable path (akin to <a href="../string/struct.String.html"><code>String</code></a>).</p>
<p>This type provides methods like <a href="struct.PathBuf.html#method.push"><code>push</code></a> and <a href="struct.PathBuf.html#method.set_extension"><code>set_extension</code></a> that mutate
the path in place. It also implements <a href="../ops/trait.Deref.html"><code>Deref</code></a> to <a href="struct.Path.html"><code>Path</code></a>, meaning that
all methods on <a href="struct.Path.html"><code>Path</code></a> slices are available on <code>PathBuf</code> values as well.</p>
<p>More details about the overall approach can be found in
the <a href="index.html">module documentation</a>.</p>
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
<p>You can use <a href="struct.PathBuf.html#method.push"><code>push</code></a> to build up a <code>PathBuf</code> from
components:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">new</span>();

<span class="ident">path</span>.<span class="ident">push</span>(<span class="string">r&quot;C:\&quot;</span>);
<span class="ident">path</span>.<span class="ident">push</span>(<span class="string">&quot;windows&quot;</span>);
<span class="ident">path</span>.<span class="ident">push</span>(<span class="string">&quot;system32&quot;</span>);

<span class="ident">path</span>.<span class="ident">set_extension</span>(<span class="string">&quot;dll&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20mut%20path%20%3D%20PathBuf%3A%3Anew()%3B%0A%0Apath.push(r%22C%3A%5C%22)%3B%0Apath.push(%22windows%22)%3B%0Apath.push(%22system32%22)%3B%0A%0Apath.set_extension(%22dll%22)%3B%0A%7D">Run</a></pre></div>
<p>However, <a href="struct.PathBuf.html#method.push"><code>push</code></a> is best used for dynamic situations. This is a better way
to do this when you know all of the components ahead of time:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="ident">path</span>: <span class="ident">PathBuf</span> <span class="op">=</span> [<span class="string">r&quot;C:\&quot;</span>, <span class="string">&quot;windows&quot;</span>, <span class="string">&quot;system32.dll&quot;</span>].<span class="ident">iter</span>().<span class="ident">collect</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20path%3A%20PathBuf%20%3D%20%5Br%22C%3A%5C%22%2C%20%22windows%22%2C%20%22system32.dll%22%5D.iter().collect()%3B%0A%7D">Run</a></pre></div>
<p>We can still do better than this! Since these are all strings, we can use
<code>From::from</code>:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">r&quot;C:\windows\system32.dll&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20path%20%3D%20PathBuf%3A%3Afrom(r%22C%3A%5Cwindows%5Csystem32.dll%22)%3B%0A%7D">Run</a></pre></div>
<p>Which method works best depends on what kind of situation you're in.</p>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1128-1456' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code id='new.v'>pub fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1143-1145' title='goto source code'>[src]</a></h4><div class='docblock'><p>Allocates an empty <code>PathBuf</code>.</p>
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">new</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20path%20%3D%20PathBuf%3A%3Anew()%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.with_capacity' class="method"><code id='with_capacity.v'>pub fn <a href='#method.with_capacity' class='fnname'>with_capacity</a>(capacity: <a class="primitive" href="../primitive.usize.html">usize</a>) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1168-1172' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>path_buf_capacity</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/58234">#58234</a>)</div></div><div class='docblock'><p>Creates a new <code>PathBuf</code> with a given capacity used to create the
internal <a href="../ffi/struct.OsString.html"><code>OsString</code></a>. See <a href="../ffi/struct.OsString.html#method.with_capacity"><code>with_capacity</code></a> defined on <a href="../ffi/struct.OsString.html"><code>OsString</code></a>.</p>
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="attribute">#![<span class="ident">feature</span>(<span class="ident">path_buf_capacity</span>)]</span>
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">with_capacity</span>(<span class="number">10</span>);
<span class="kw">let</span> <span class="ident">capacity</span> <span class="op">=</span> <span class="ident">path</span>.<span class="ident">capacity</span>();

<span class="comment">// This push is done without reallocating</span>
<span class="ident">path</span>.<span class="ident">push</span>(<span class="string">r&quot;C:\&quot;</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">capacity</span>, <span class="ident">path</span>.<span class="ident">capacity</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(path_buf_capacity)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20mut%20path%20%3D%20PathBuf%3A%3Awith_capacity(10)%3B%0Alet%20capacity%20%3D%20path.capacity()%3B%0A%0A%2F%2F%20This%20push%20is%20done%20without%20reallocating%0Apath.push(r%22C%3A%5C%22)%3B%0A%0Aassert_eq!(capacity%2C%20path.capacity())%3B%0A%7D&amp;version=nightly">Run</a></pre></div>
</div><h4 id='method.as_path' class="method"><code id='as_path.v'>pub fn <a href='#method.as_path' class='fnname'>as_path</a>(&amp;self) -&gt; &amp;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a class='srclink' href='../../src/std/path.rs.html#1187-1189' title='goto source code'>[src]</a></h4><div class='docblock'><p>Coerces to a <a href="struct.Path.html"><code>Path</code></a> slice.</p>
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">PathBuf</span>};

<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/test&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/test&quot;</span>), <span class="ident">p</span>.<span class="ident">as_path</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20PathBuf%7D%3B%0A%0Alet%20p%20%3D%20PathBuf%3A%3Afrom(%22%2Ftest%22)%3B%0Aassert_eq!(Path%3A%3Anew(%22%2Ftest%22)%2C%20p.as_path())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.push' class="method"><code id='push.v'>pub fn <a href='#method.push' class='fnname'>push</a>&lt;P:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt;(&amp;mut self, path: P)</code><a class='srclink' href='../../src/std/path.rs.html#1223-1225' title='goto source code'>[src]</a></h4><div class='docblock'><p>Extends <code>self</code> with <code>path</code>.</p>
<p>If <code>path</code> is absolute, it replaces the current path.</p>
<p>On Windows:</p>
<ul>
<li>if <code>path</code> has a root but no prefix (e.g., <code>\windows</code>), it
replaces everything except for the prefix (if any) of <code>self</code>.</li>
<li>if <code>path</code> has a prefix but no root, it replaces <code>self</code>.</li>
</ul>
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
<p>Pushing a relative path extends the existing path:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/tmp&quot;</span>);
<span class="ident">path</span>.<span class="ident">push</span>(<span class="string">&quot;file.bk&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>, <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/tmp/file.bk&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20mut%20path%20%3D%20PathBuf%3A%3Afrom(%22%2Ftmp%22)%3B%0Apath.push(%22file.bk%22)%3B%0Aassert_eq!(path%2C%20PathBuf%3A%3Afrom(%22%2Ftmp%2Ffile.bk%22))%3B%0A%7D">Run</a></pre></div>
<p>Pushing an absolute path replaces the existing path:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/tmp&quot;</span>);
<span class="ident">path</span>.<span class="ident">push</span>(<span class="string">&quot;/etc&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>, <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/etc&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20mut%20path%20%3D%20PathBuf%3A%3Afrom(%22%2Ftmp%22)%3B%0Apath.push(%22%2Fetc%22)%3B%0Aassert_eq!(path%2C%20PathBuf%3A%3Afrom(%22%2Fetc%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.pop' class="method"><code id='pop.v'>pub fn <a href='#method.pop' class='fnname'>pop</a>(&amp;mut self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#1278-1286' title='goto source code'>[src]</a></h4><div class='docblock'><p>Truncates <code>self</code> to <a href="struct.PathBuf.html#method.parent"><code>self.parent</code></a>.</p>
<p>Returns <code>false</code> and does nothing if <a href="struct.PathBuf.html#method.parent"><code>self.parent</code></a> is <a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>.
Otherwise, returns <code>true</code>.</p>
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">PathBuf</span>};

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/test/test.rs&quot;</span>);

<span class="ident">p</span>.<span class="ident">pop</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/test&quot;</span>), <span class="ident">p</span>);
<span class="ident">p</span>.<span class="ident">pop</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/&quot;</span>), <span class="ident">p</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20PathBuf%7D%3B%0A%0Alet%20mut%20p%20%3D%20PathBuf%3A%3Afrom(%22%2Ftest%2Ftest.rs%22)%3B%0A%0Ap.pop()%3B%0Aassert_eq!(Path%3A%3Anew(%22%2Ftest%22)%2C%20p)%3B%0Ap.pop()%3B%0Aassert_eq!(Path%3A%3Anew(%22%2F%22)%2C%20p)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.set_file_name' class="method"><code id='set_file_name.v'>pub fn <a href='#method.set_file_name' class='fnname'>set_file_name</a>&lt;S:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt;(&amp;mut self, file_name: S)</code><a class='srclink' href='../../src/std/path.rs.html#1315-1317' title='goto source code'>[src]</a></h4><div class='docblock'><p>Updates <a href="struct.PathBuf.html#method.file_name"><code>self.file_name</code></a> to <code>file_name</code>.</p>
<p>If <a href="struct.PathBuf.html#method.file_name"><code>self.file_name</code></a> was <a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>, this is equivalent to pushing
<code>file_name</code>.</p>
<p>Otherwise it is equivalent to calling <a href="struct.PathBuf.html#method.pop"><code>pop</code></a> and then pushing
<code>file_name</code>. The new path will be a sibling of the original path.
(That is, it will have the same parent.)</p>
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buf</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/&quot;</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">buf</span>.<span class="ident">file_name</span>() <span class="op">==</span> <span class="prelude-val">None</span>);
<span class="ident">buf</span>.<span class="ident">set_file_name</span>(<span class="string">&quot;bar&quot;</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">buf</span> <span class="op">==</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/bar&quot;</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">buf</span>.<span class="ident">file_name</span>().<span class="ident">is_some</span>());
<span class="ident">buf</span>.<span class="ident">set_file_name</span>(<span class="string">&quot;baz.txt&quot;</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">buf</span> <span class="op">==</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/baz.txt&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20mut%20buf%20%3D%20PathBuf%3A%3Afrom(%22%2F%22)%3B%0Aassert!(buf.file_name()%20%3D%3D%20None)%3B%0Abuf.set_file_name(%22bar%22)%3B%0Aassert!(buf%20%3D%3D%20PathBuf%3A%3Afrom(%22%2Fbar%22))%3B%0Aassert!(buf.file_name().is_some())%3B%0Abuf.set_file_name(%22baz.txt%22)%3B%0Aassert!(buf%20%3D%3D%20PathBuf%3A%3Afrom(%22%2Fbaz.txt%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.set_extension' class="method"><code id='set_extension.v'>pub fn <a href='#method.set_extension' class='fnname'>set_extension</a>&lt;S:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt;(&amp;mut self, extension: S) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#1353-1355' title='goto source code'>[src]</a></h4><div class='docblock'><p>Updates <a href="struct.PathBuf.html#method.extension"><code>self.extension</code></a> to <code>extension</code>.</p>
<p>Returns <code>false</code> and does nothing if <a href="struct.PathBuf.html#method.file_name"><code>self.file_name</code></a> is <a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>,
returns <code>true</code> and updates the extension otherwise.</p>
<p>If <a href="struct.PathBuf.html#method.extension"><code>self.extension</code></a> is <a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>, the extension is added; otherwise
it is replaced.</p>
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">PathBuf</span>};

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/feel/the&quot;</span>);

<span class="ident">p</span>.<span class="ident">set_extension</span>(<span class="string">&quot;force&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/feel/the.force&quot;</span>), <span class="ident">p</span>.<span class="ident">as_path</span>());

<span class="ident">p</span>.<span class="ident">set_extension</span>(<span class="string">&quot;dark_side&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/feel/the.dark_side&quot;</span>), <span class="ident">p</span>.<span class="ident">as_path</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20PathBuf%7D%3B%0A%0Alet%20mut%20p%20%3D%20PathBuf%3A%3Afrom(%22%2Ffeel%2Fthe%22)%3B%0A%0Ap.set_extension(%22force%22)%3B%0Aassert_eq!(Path%3A%3Anew(%22%2Ffeel%2Fthe.force%22)%2C%20p.as_path())%3B%0A%0Ap.set_extension(%22dark_side%22)%3B%0Aassert_eq!(Path%3A%3Anew(%22%2Ffeel%2Fthe.dark_side%22)%2C%20p.as_path())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.into_os_string' class="method"><code id='into_os_string.v'>pub fn <a href='#method.into_os_string' class='fnname'>into_os_string</a>(self) -&gt; <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code><a class='srclink' href='../../src/std/path.rs.html#1389-1391' title='goto source code'>[src]</a></h4><div class='docblock'><p>Consumes the <code>PathBuf</code>, yielding its internal <a href="../ffi/struct.OsString.html"><code>OsString</code></a> storage.</p>
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>;

<span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/the/head&quot;</span>);
<span class="kw">let</span> <span class="ident">os_str</span> <span class="op">=</span> <span class="ident">p</span>.<span class="ident">into_os_string</span>();<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APathBuf%3B%0A%0Alet%20p%20%3D%20PathBuf%3A%3Afrom(%22%2Fthe%2Fhead%22)%3B%0Alet%20os_str%20%3D%20p.into_os_string()%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.into_boxed_path' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;I&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;I&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;I&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;F&gt; <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>&gt; <a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;R&gt;</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>&gt; <a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;W&gt;</span></code></div></div><code id='into_boxed_path.v'>pub fn <a href='#method.into_boxed_path' class='fnname'>into_boxed_path</a>(self) -&gt; <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><div class='since' title='Stable since Rust version 1.20.0'>1.20.0</div><a class='srclink' href='../../src/std/path.rs.html#1398-1401' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts this <code>PathBuf</code> into a <a href="../../std/boxed/struct.Box.html">boxed</a> <a href="struct.Path.html"><code>Path</code></a>.</p>
</div><h4 id='method.capacity' class="method"><code id='capacity.v'>pub fn <a href='#method.capacity' class='fnname'>capacity</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.usize.html">usize</a></code><a class='srclink' href='../../src/std/path.rs.html#1408-1410' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>path_buf_capacity</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/58234">#58234</a>)</div></div><div class='docblock'><p>Invokes <a href="../ffi/struct.OsString.html#method.capacity"><code>capacity</code></a> on the underlying instance of <a href="../ffi/struct.OsString.html"><code>OsString</code></a>.</p>
</div><h4 id='method.clear' class="method"><code id='clear.v'>pub fn <a href='#method.clear' class='fnname'>clear</a>(&amp;mut self)</code><a class='srclink' href='../../src/std/path.rs.html#1417-1419' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>path_buf_capacity</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/58234">#58234</a>)</div></div><div class='docblock'><p>Invokes <a href="../ffi/struct.OsString.html#method.clear"><code>clear</code></a> on the underlying instance of <a href="../ffi/struct.OsString.html"><code>OsString</code></a>.</p>
</div><h4 id='method.reserve' class="method"><code id='reserve.v'>pub fn <a href='#method.reserve' class='fnname'>reserve</a>(&amp;mut self, additional: <a class="primitive" href="../primitive.usize.html">usize</a>)</code><a class='srclink' href='../../src/std/path.rs.html#1426-1428' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>path_buf_capacity</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/58234">#58234</a>)</div></div><div class='docblock'><p>Invokes <a href="../ffi/struct.OsString.html#method.reserve"><code>reserve</code></a> on the underlying instance of <a href="../ffi/struct.OsString.html"><code>OsString</code></a>.</p>
</div><h4 id='method.reserve_exact' class="method"><code id='reserve_exact.v'>pub fn <a href='#method.reserve_exact' class='fnname'>reserve_exact</a>(&amp;mut self, additional: <a class="primitive" href="../primitive.usize.html">usize</a>)</code><a class='srclink' href='../../src/std/path.rs.html#1435-1437' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>path_buf_capacity</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/58234">#58234</a>)</div></div><div class='docblock'><p>Invokes <a href="../ffi/struct.OsString.html#method.reserve_exact"><code>reserve_exact</code></a> on the underlying instance of <a href="../ffi/struct.OsString.html"><code>OsString</code></a>.</p>
</div><h4 id='method.shrink_to_fit' class="method"><code id='shrink_to_fit.v'>pub fn <a href='#method.shrink_to_fit' class='fnname'>shrink_to_fit</a>(&amp;mut self)</code><a class='srclink' href='../../src/std/path.rs.html#1444-1446' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>path_buf_capacity</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/58234">#58234</a>)</div></div><div class='docblock'><p>Invokes <a href="../ffi/struct.OsString.html#method.shrink_to_fit"><code>shrink_to_fit</code></a> on the underlying instance of <a href="../ffi/struct.OsString.html"><code>OsString</code></a>.</p>
</div><h4 id='method.shrink_to' class="method"><code id='shrink_to.v'>pub fn <a href='#method.shrink_to' class='fnname'>shrink_to</a>(&amp;mut self, min_capacity: <a class="primitive" href="../primitive.usize.html">usize</a>)</code><a class='srclink' href='../../src/std/path.rs.html#1453-1455' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>path_buf_capacity</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/58234">#58234</a>)</div></div><div class='docblock'><p>Invokes <a href="../ffi/struct.OsString.html#method.shrink_to"><code>shrink_to</code></a> on the underlying instance of <a href="../ffi/struct.OsString.html"><code>OsString</code></a>.</p>
</div></div><h2 id='deref-methods' class='small-section-header'>Methods from <a class="trait" href="../../std/ops/trait.Deref.html" title="trait std::ops::Deref">Deref</a>&lt;Target = <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;<a href='#deref-methods' class='anchor'></a></h2><div class='impl-items'><h4 id='method.as_os_str' class="method"><code id='as_os_str.v'>pub fn <a href='#method.as_os_str' class='fnname'>as_os_str</a>(&amp;self) -&gt; &amp;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a></code><a class='srclink' href='../../src/std/path.rs.html#1813-1815' title='goto source code'>[src]</a></h4><div class='docblock'><p>Yields the underlying <a href="../ffi/struct.OsStr.html"><code>OsStr</code></a> slice.</p>
<h1 id="examples-9" class="section-header"><a href="#examples-9">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">os_str</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>).<span class="ident">as_os_str</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">os_str</span>, <span class="ident">std</span>::<span class="ident">ffi</span>::<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20os_str%20%3D%20Path%3A%3Anew(%22foo.txt%22).as_os_str()%3B%0Aassert_eq!(os_str%2C%20std%3A%3Affi%3A%3AOsStr%3A%3Anew(%22foo.txt%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.to_str' class="method"><code id='to_str.v'>pub fn <a href='#method.to_str' class='fnname'>to_str</a>(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;&amp;<a class="primitive" href="../primitive.str.html">str</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1832-1834' title='goto source code'>[src]</a></h4><div class='docblock'><p>Yields a <a href="../primitive.str.html"><code>&amp;str</code></a> slice if the <code>Path</code> is valid unicode.</p>
<p>This conversion may entail doing a check for UTF-8 validity.</p>
<h1 id="examples-10" class="section-header"><a href="#examples-10">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">to_str</span>(), <span class="prelude-val">Some</span>(<span class="string">&quot;foo.txt&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22foo.txt%22)%3B%0Aassert_eq!(path.to_str()%2C%20Some(%22foo.txt%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.to_string_lossy' class="method"><code id='to_string_lossy.v'>pub fn <a href='#method.to_string_lossy' class='fnname'>to_string_lossy</a>(&amp;self) -&gt; <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;<a class="primitive" href="../primitive.str.html">str</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1858-1860' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a <code>Path</code> to a <a href="../borrow/enum.Cow.html"><code>Cow&lt;str&gt;</code></a>.</p>
<p>Any non-Unicode sequences are replaced with
<a href="../char/constant.REPLACEMENT_CHARACTER.html"><code>U+FFFD REPLACEMENT CHARACTER</code></a>.</p>
<h1 id="examples-11" class="section-header"><a href="#examples-11">Examples</a></h1>
<p>Calling <code>to_string_lossy</code> on a <code>Path</code> with valid unicode:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">to_string_lossy</span>(), <span class="string">&quot;foo.txt&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22foo.txt%22)%3B%0Aassert_eq!(path.to_string_lossy()%2C%20%22foo.txt%22)%3B%0A%7D">Run</a></pre></div>
<p>Had <code>path</code> contained invalid unicode, the <code>to_string_lossy</code> call might
have returned <code>&quot;fo�.txt&quot;</code>.</p>
</div><h4 id='method.to_path_buf' class="method"><code id='to_path_buf.v'>pub fn <a href='#method.to_path_buf' class='fnname'>to_path_buf</a>(&amp;self) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1876-1878' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a <code>Path</code> to an owned <a href="struct.PathBuf.html"><code>PathBuf</code></a>.</p>
<h1 id="examples-12" class="section-header"><a href="#examples-12">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path_buf</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>).<span class="ident">to_path_buf</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path_buf</span>, <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;foo.txt&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path_buf%20%3D%20Path%3A%3Anew(%22foo.txt%22).to_path_buf()%3B%0Aassert_eq!(path_buf%2C%20std%3A%3Apath%3A%3APathBuf%3A%3Afrom(%22foo.txt%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_absolute' class="method"><code id='is_absolute.v'>pub fn <a href='#method.is_absolute' class='fnname'>is_absolute</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#1900-1907' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the <code>Path</code> is absolute, i.e., if it is independent of
the current directory.</p>
<ul>
<li>
<p>On Unix, a path is absolute if it starts with the root, so
<code>is_absolute</code> and <a href="#method.has_root"><code>has_root</code></a> are equivalent.</p>
</li>
<li>
<p>On Windows, a path is absolute if it has a prefix and starts with the
root: <code>c:\windows</code> is absolute, while <code>c:temp</code> and <code>\temp</code> are not.</p>
</li>
</ul>
<h1 id="examples-13" class="section-header"><a href="#examples-13">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>).<span class="ident">is_absolute</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Aassert!(!Path%3A%3Anew(%22foo.txt%22).is_absolute())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.is_relative' class="method"><code id='is_relative.v'>pub fn <a href='#method.is_relative' class='fnname'>is_relative</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#1923-1925' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the <code>Path</code> is relative, i.e., not absolute.</p>
<p>See <a href="#method.is_absolute"><code>is_absolute</code></a>'s documentation for more details.</p>
<h1 id="examples-14" class="section-header"><a href="#examples-14">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>).<span class="ident">is_relative</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Aassert!(Path%3A%3Anew(%22foo.txt%22).is_relative())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.has_root' class="method"><code id='has_root.v'>pub fn <a href='#method.has_root' class='fnname'>has_root</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#1948-1950' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the <code>Path</code> has a root.</p>
<ul>
<li>
<p>On Unix, a path has a root if it begins with <code>/</code>.</p>
</li>
<li>
<p>On Windows, a path has a root if it:</p>
<ul>
<li>has no prefix and begins with a separator, e.g., <code>\windows</code></li>
<li>has a prefix followed by a separator, e.g., <code>c:\windows</code> but not <code>c:windows</code></li>
<li>has any non-disk prefix, e.g., <code>\\server\share</code></li>
</ul>
</li>
</ul>
<h1 id="examples-15" class="section-header"><a href="#examples-15">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/etc/passwd&quot;</span>).<span class="ident">has_root</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Aassert!(Path%3A%3Anew(%22%2Fetc%2Fpasswd%22).has_root())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.parent' class="method"><code id='parent.v'>pub fn <a href='#method.parent' class='fnname'>parent</a>(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;&amp;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1972-1983' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the <code>Path</code> without its final component, if there is one.</p>
<p>Returns <a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a> if the path terminates in a root or prefix.</p>
<h1 id="examples-16" class="section-header"><a href="#examples-16">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/foo/bar&quot;</span>);
<span class="kw">let</span> <span class="ident">parent</span> <span class="op">=</span> <span class="ident">path</span>.<span class="ident">parent</span>().<span class="ident">unwrap</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parent</span>, <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/foo&quot;</span>));

<span class="kw">let</span> <span class="ident">grand_parent</span> <span class="op">=</span> <span class="ident">parent</span>.<span class="ident">parent</span>().<span class="ident">unwrap</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">grand_parent</span>, <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/&quot;</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">grand_parent</span>.<span class="ident">parent</span>(), <span class="prelude-val">None</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Ffoo%2Fbar%22)%3B%0Alet%20parent%20%3D%20path.parent().unwrap()%3B%0Aassert_eq!(parent%2C%20Path%3A%3Anew(%22%2Ffoo%22))%3B%0A%0Alet%20grand_parent%20%3D%20parent.parent().unwrap()%3B%0Aassert_eq!(grand_parent%2C%20Path%3A%3Anew(%22%2F%22))%3B%0Aassert_eq!(grand_parent.parent()%2C%20None)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.ancestors' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/path/struct.Ancestors.html" title="struct std::path::Ancestors">Ancestors</a>&lt;'a&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/path/struct.Ancestors.html" title="struct std::path::Ancestors">Ancestors</a>&lt;'a&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/path/struct.Ancestors.html" title="struct std::path::Ancestors">Ancestors</a>&lt;'a&gt;</span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>;</span></code></div></div><code id='ancestors.v'>pub fn <a href='#method.ancestors' class='fnname'>ancestors</a>(&amp;self) -&gt; <a class="struct" href="../../std/path/struct.Ancestors.html" title="struct std::path::Ancestors">Ancestors</a></code><div class='since' title='Stable since Rust version 1.28.0'>1.28.0</div><a class='srclink' href='../../src/std/path.rs.html#2008-2012' title='goto source code'>[src]</a></h4><div class='docblock'><p>Produces an iterator over <code>Path</code> and its ancestors.</p>
<p>The iterator will yield the <code>Path</code> that is returned if the <a href="struct.Path.html#method.parent"><code>parent</code></a> method is used zero
or more times. That means, the iterator will yield <code>&amp;self</code>, <code>&amp;self.parent().unwrap()</code>,
<code>&amp;self.parent().unwrap().parent().unwrap()</code> and so on. If the <a href="struct.Path.html#method.parent"><code>parent</code></a> method returns
<a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>, the iterator will do likewise. The iterator will always yield at least one value,
namely <code>&amp;self</code>.</p>
<h1 id="examples-17" class="section-header"><a href="#examples-17">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ancestors</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/foo/bar&quot;</span>).<span class="ident">ancestors</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ancestors</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/foo/bar&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ancestors</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/foo&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ancestors</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ancestors</span>.<span class="ident">next</span>(), <span class="prelude-val">None</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20mut%20ancestors%20%3D%20Path%3A%3Anew(%22%2Ffoo%2Fbar%22).ancestors()%3B%0Aassert_eq!(ancestors.next()%2C%20Some(Path%3A%3Anew(%22%2Ffoo%2Fbar%22)))%3B%0Aassert_eq!(ancestors.next()%2C%20Some(Path%3A%3Anew(%22%2Ffoo%22)))%3B%0Aassert_eq!(ancestors.next()%2C%20Some(Path%3A%3Anew(%22%2F%22)))%3B%0Aassert_eq!(ancestors.next()%2C%20None)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.file_name' class="method"><code id='file_name.v'>pub fn <a href='#method.file_name' class='fnname'>file_name</a>(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;&amp;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2037-2044' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the final component of the <code>Path</code>, if there is one.</p>
<p>If the path is a normal file, this is the file name. If it's the path of a directory, this
is the directory name.</p>
<p>Returns <a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a> if the path terminates in <code>..</code>.</p>
<h1 id="examples-18" class="section-header"><a href="#examples-18">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ffi</span>::<span class="ident">OsStr</span>;

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;bin&quot;</span>)), <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/usr/bin/&quot;</span>).<span class="ident">file_name</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>)), <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;tmp/foo.txt&quot;</span>).<span class="ident">file_name</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>)), <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt/.&quot;</span>).<span class="ident">file_name</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>)), <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt/.//&quot;</span>).<span class="ident">file_name</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt/..&quot;</span>).<span class="ident">file_name</span>());
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">None</span>, <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/&quot;</span>).<span class="ident">file_name</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0Ause%20std%3A%3Affi%3A%3AOsStr%3B%0A%0Aassert_eq!(Some(OsStr%3A%3Anew(%22bin%22))%2C%20Path%3A%3Anew(%22%2Fusr%2Fbin%2F%22).file_name())%3B%0Aassert_eq!(Some(OsStr%3A%3Anew(%22foo.txt%22))%2C%20Path%3A%3Anew(%22tmp%2Ffoo.txt%22).file_name())%3B%0Aassert_eq!(Some(OsStr%3A%3Anew(%22foo.txt%22))%2C%20Path%3A%3Anew(%22foo.txt%2F.%22).file_name())%3B%0Aassert_eq!(Some(OsStr%3A%3Anew(%22foo.txt%22))%2C%20Path%3A%3Anew(%22foo.txt%2F.%2F%2F%22).file_name())%3B%0Aassert_eq!(None%2C%20Path%3A%3Anew(%22foo.txt%2F..%22).file_name())%3B%0Aassert_eq!(None%2C%20Path%3A%3Anew(%22%2F%22).file_name())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.strip_prefix' class="method"><code id='strip_prefix.v'>pub fn <a href='#method.strip_prefix' class='fnname'>strip_prefix</a>&lt;P&gt;(&amp;self, base: P) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;&amp;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>, <a class="struct" href="../../std/path/struct.StripPrefixError.html" title="struct std::path::StripPrefixError">StripPrefixError</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,&nbsp;</span></code><div class='since' title='Stable since Rust version 1.7.0'>1.7.0</div><a class='srclink' href='../../src/std/path.rs.html#2075-2080' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns a path that, when joined onto <code>base</code>, yields <code>self</code>.</p>
<h1 id="errors" class="section-header"><a href="#errors">Errors</a></h1>
<p>If <code>base</code> is not a prefix of <code>self</code> (i.e., <a href="#method.starts_with"><code>starts_with</code></a>
returns <code>false</code>), returns <a href="../../std/result/enum.Result.html#variant.Err"><code>Err</code></a>.</p>
<h1 id="examples-19" class="section-header"><a href="#examples-19">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">PathBuf</span>};

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/test/haha/foo.txt&quot;</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">strip_prefix</span>(<span class="string">&quot;/&quot;</span>), <span class="prelude-val">Ok</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;test/haha/foo.txt&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">strip_prefix</span>(<span class="string">&quot;/test&quot;</span>), <span class="prelude-val">Ok</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;haha/foo.txt&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">strip_prefix</span>(<span class="string">&quot;/test/&quot;</span>), <span class="prelude-val">Ok</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;haha/foo.txt&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">strip_prefix</span>(<span class="string">&quot;/test/haha/foo.txt&quot;</span>), <span class="prelude-val">Ok</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">strip_prefix</span>(<span class="string">&quot;/test/haha/foo.txt/&quot;</span>), <span class="prelude-val">Ok</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">strip_prefix</span>(<span class="string">&quot;test&quot;</span>).<span class="ident">is_ok</span>(), <span class="bool-val">false</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">strip_prefix</span>(<span class="string">&quot;/haha&quot;</span>).<span class="ident">is_ok</span>(), <span class="bool-val">false</span>);

<span class="kw">let</span> <span class="ident">prefix</span> <span class="op">=</span> <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/test/&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">strip_prefix</span>(<span class="ident">prefix</span>), <span class="prelude-val">Ok</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;haha/foo.txt&quot;</span>)));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20PathBuf%7D%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Ftest%2Fhaha%2Ffoo.txt%22)%3B%0A%0Aassert_eq!(path.strip_prefix(%22%2F%22)%2C%20Ok(Path%3A%3Anew(%22test%2Fhaha%2Ffoo.txt%22)))%3B%0Aassert_eq!(path.strip_prefix(%22%2Ftest%22)%2C%20Ok(Path%3A%3Anew(%22haha%2Ffoo.txt%22)))%3B%0Aassert_eq!(path.strip_prefix(%22%2Ftest%2F%22)%2C%20Ok(Path%3A%3Anew(%22haha%2Ffoo.txt%22)))%3B%0Aassert_eq!(path.strip_prefix(%22%2Ftest%2Fhaha%2Ffoo.txt%22)%2C%20Ok(Path%3A%3Anew(%22%22)))%3B%0Aassert_eq!(path.strip_prefix(%22%2Ftest%2Fhaha%2Ffoo.txt%2F%22)%2C%20Ok(Path%3A%3Anew(%22%22)))%3B%0Aassert_eq!(path.strip_prefix(%22test%22).is_ok()%2C%20false)%3B%0Aassert_eq!(path.strip_prefix(%22%2Fhaha%22).is_ok()%2C%20false)%3B%0A%0Alet%20prefix%20%3D%20PathBuf%3A%3Afrom(%22%2Ftest%2F%22)%3B%0Aassert_eq!(path.strip_prefix(prefix)%2C%20Ok(Path%3A%3Anew(%22haha%2Ffoo.txt%22)))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.starts_with' class="method"><code id='starts_with.v'>pub fn <a href='#method.starts_with' class='fnname'>starts_with</a>&lt;P:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt;(&amp;self, base: P) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2108-2110' title='goto source code'>[src]</a></h4><div class='docblock'><p>Determines whether <code>base</code> is a prefix of <code>self</code>.</p>
<p>Only considers whole path components to match.</p>
<h1 id="examples-20" class="section-header"><a href="#examples-20">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/etc/passwd&quot;</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">starts_with</span>(<span class="string">&quot;/etc&quot;</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">starts_with</span>(<span class="string">&quot;/etc/&quot;</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">starts_with</span>(<span class="string">&quot;/etc/passwd&quot;</span>));
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">starts_with</span>(<span class="string">&quot;/etc/passwd/&quot;</span>));

<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">path</span>.<span class="ident">starts_with</span>(<span class="string">&quot;/e&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Fetc%2Fpasswd%22)%3B%0A%0Aassert!(path.starts_with(%22%2Fetc%22))%3B%0Aassert!(path.starts_with(%22%2Fetc%2F%22))%3B%0Aassert!(path.starts_with(%22%2Fetc%2Fpasswd%22))%3B%0Aassert!(path.starts_with(%22%2Fetc%2Fpasswd%2F%22))%3B%0A%0Aassert!(!path.starts_with(%22%2Fe%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.ends_with' class="method"><code id='ends_with.v'>pub fn <a href='#method.ends_with' class='fnname'>ends_with</a>&lt;P:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt;(&amp;self, child: P) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2130-2132' title='goto source code'>[src]</a></h4><div class='docblock'><p>Determines whether <code>child</code> is a suffix of <code>self</code>.</p>
<p>Only considers whole path components to match.</p>
<h1 id="examples-21" class="section-header"><a href="#examples-21">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/etc/passwd&quot;</span>);

<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">ends_with</span>(<span class="string">&quot;passwd&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Fetc%2Fpasswd%22)%3B%0A%0Aassert!(path.ends_with(%22passwd%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.file_stem' class="method"><code id='file_stem.v'>pub fn <a href='#method.file_stem' class='fnname'>file_stem</a>(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;&amp;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2161-2163' title='goto source code'>[src]</a></h4><div class='docblock'><p>Extracts the stem (non-extension) portion of <a href="struct.Path.html#method.file_name"><code>self.file_name</code></a>.</p>
<p>The stem is:</p>
<ul>
<li><a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>, if there is no file name;</li>
<li>The entire file name if there is no embedded <code>.</code>;</li>
<li>The entire file name if the file name begins with <code>.</code> and has no other <code>.</code>s within;</li>
<li>Otherwise, the portion of the file name before the final <code>.</code></li>
</ul>
<h1 id="examples-22" class="section-header"><a href="#examples-22">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.rs&quot;</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;foo&quot;</span>, <span class="ident">path</span>.<span class="ident">file_stem</span>().<span class="ident">unwrap</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22foo.rs%22)%3B%0A%0Aassert_eq!(%22foo%22%2C%20path.file_stem().unwrap())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.extension' class="method"><code id='extension.v'>pub fn <a href='#method.extension' class='fnname'>extension</a>(&amp;self) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;&amp;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2187-2189' title='goto source code'>[src]</a></h4><div class='docblock'><p>Extracts the extension of <a href="struct.Path.html#method.file_name"><code>self.file_name</code></a>, if possible.</p>
<p>The extension is:</p>
<ul>
<li><a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>, if there is no file name;</li>
<li><a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>, if there is no embedded <code>.</code>;</li>
<li><a href="../../std/option/enum.Option.html#variant.None"><code>None</code></a>, if the file name begins with <code>.</code> and has no other <code>.</code>s within;</li>
<li>Otherwise, the portion of the file name after the final <code>.</code></li>
</ul>
<h1 id="examples-23" class="section-header"><a href="#examples-23">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.rs&quot;</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="string">&quot;rs&quot;</span>, <span class="ident">path</span>.<span class="ident">extension</span>().<span class="ident">unwrap</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22foo.rs%22)%3B%0A%0Aassert_eq!(%22rs%22%2C%20path.extension().unwrap())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.join' class="method"><code id='join.v'>pub fn <a href='#method.join' class='fnname'>join</a>&lt;P:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt;(&amp;self, path: P) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#2206-2208' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates an owned <a href="struct.PathBuf.html"><code>PathBuf</code></a> with <code>path</code> adjoined to <code>self</code>.</p>
<p>See <a href="struct.PathBuf.html#method.push"><code>PathBuf::push</code></a> for more details on what it means to adjoin a path.</p>
<h1 id="examples-24" class="section-header"><a href="#examples-24">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">PathBuf</span>};

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/etc&quot;</span>).<span class="ident">join</span>(<span class="string">&quot;passwd&quot;</span>), <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/etc/passwd&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20PathBuf%7D%3B%0A%0Aassert_eq!(Path%3A%3Anew(%22%2Fetc%22).join(%22passwd%22)%2C%20PathBuf%3A%3Afrom(%22%2Fetc%2Fpasswd%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.with_file_name' class="method"><code id='with_file_name.v'>pub fn <a href='#method.with_file_name' class='fnname'>with_file_name</a>&lt;S:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt;(&amp;self, file_name: S) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#2235-2237' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates an owned <a href="struct.PathBuf.html"><code>PathBuf</code></a> like <code>self</code> but with the given file name.</p>
<p>See <a href="struct.PathBuf.html#method.set_file_name"><code>PathBuf::set_file_name</code></a> for more details.</p>
<h1 id="examples-25" class="section-header"><a href="#examples-25">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">PathBuf</span>};

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/tmp/foo.txt&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">with_file_name</span>(<span class="string">&quot;bar.txt&quot;</span>), <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/tmp/bar.txt&quot;</span>));

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/tmp&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">with_file_name</span>(<span class="string">&quot;var&quot;</span>), <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/var&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20PathBuf%7D%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Ftmp%2Ffoo.txt%22)%3B%0Aassert_eq!(path.with_file_name(%22bar.txt%22)%2C%20PathBuf%3A%3Afrom(%22%2Ftmp%2Fbar.txt%22))%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Ftmp%22)%3B%0Aassert_eq!(path.with_file_name(%22var%22)%2C%20PathBuf%3A%3Afrom(%22%2Fvar%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.with_extension' class="method"><code id='with_extension.v'>pub fn <a href='#method.with_extension' class='fnname'>with_extension</a>&lt;S:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt;(&amp;self, extension: S) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#2261-2263' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates an owned <a href="struct.PathBuf.html"><code>PathBuf</code></a> like <code>self</code> but with the given extension.</p>
<p>See <a href="struct.PathBuf.html#method.set_extension"><code>PathBuf::set_extension</code></a> for more details.</p>
<h1 id="examples-26" class="section-header"><a href="#examples-26">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">PathBuf</span>};

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;foo.rs&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">with_extension</span>(<span class="string">&quot;txt&quot;</span>), <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;foo.txt&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20PathBuf%7D%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22foo.rs%22)%3B%0Aassert_eq!(path.with_extension(%22txt%22)%2C%20PathBuf%3A%3Afrom(%22foo.txt%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.components' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/path/struct.Components.html" title="struct std::path::Components">Components</a>&lt;'a&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/path/struct.Components.html" title="struct std::path::Components">Components</a>&lt;'a&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/path/struct.Components.html" title="struct std::path::Components">Components</a>&lt;'a&gt;</span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="enum" href="../../std/path/enum.Component.html" title="enum std::path::Component">Component</a>&lt;'a&gt;;</span></code></div></div><code id='components.v'>pub fn <a href='#method.components' class='fnname'>components</a>(&amp;self) -&gt; <a class="struct" href="../../std/path/struct.Components.html" title="struct std::path::Components">Components</a></code><a class='srclink' href='../../src/std/path.rs.html#2306-2316' title='goto source code'>[src]</a></h4><div class='docblock'><p>Produces an iterator over the <a href="enum.Component.html"><code>Component</code></a>s of the path.</p>
<p>When parsing the path, there is a small amount of normalization:</p>
<ul>
<li>
<p>Repeated separators are ignored, so <code>a/b</code> and <code>a//b</code> both have
<code>a</code> and <code>b</code> as components.</p>
</li>
<li>
<p>Occurrences of <code>.</code> are normalized away, except if they are at the
beginning of the path. For example, <code>a/./b</code>, <code>a/b/</code>, <code>a/b/.</code> and
<code>a/b</code> all have <code>a</code> and <code>b</code> as components, but <code>./a/b</code> starts with
an additional <a href="enum.Component.html#variant.CurDir"><code>CurDir</code></a> component.</p>
</li>
<li>
<p>A trailing slash is normalized away, <code>/a/b</code> and <code>/a/b/</code> are equivalent.</p>
</li>
</ul>
<p>Note that no other normalization takes place; in particular, <code>a/c</code>
and <code>a/b/../c</code> are distinct, to account for the possibility that <code>b</code>
is a symbolic link (so its parent isn't <code>a</code>).</p>
<h1 id="examples-27" class="section-header"><a href="#examples-27">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">Component</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ffi</span>::<span class="ident">OsStr</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">components</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/tmp/foo.txt&quot;</span>).<span class="ident">components</span>();

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">components</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">Component</span>::<span class="ident">RootDir</span>));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">components</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">Component</span>::<span class="ident">Normal</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;tmp&quot;</span>))));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">components</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">Component</span>::<span class="ident">Normal</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>))));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">components</span>.<span class="ident">next</span>(), <span class="prelude-val">None</span>)<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20Component%7D%3B%0Ause%20std%3A%3Affi%3A%3AOsStr%3B%0A%0Alet%20mut%20components%20%3D%20Path%3A%3Anew(%22%2Ftmp%2Ffoo.txt%22).components()%3B%0A%0Aassert_eq!(components.next()%2C%20Some(Component%3A%3ARootDir))%3B%0Aassert_eq!(components.next()%2C%20Some(Component%3A%3ANormal(OsStr%3A%3Anew(%22tmp%22))))%3B%0Aassert_eq!(components.next()%2C%20Some(Component%3A%3ANormal(OsStr%3A%3Anew(%22foo.txt%22))))%3B%0Aassert_eq!(components.next()%2C%20None)%0A%7D">Run</a></pre></div>
</div><h4 id='method.iter' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a>&lt;'a&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a>&lt;'a&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a>&lt;'a&gt;</span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>;</span></code></div></div><code id='iter.v'>pub fn <a href='#method.iter' class='fnname'>iter</a>(&amp;self) -&gt; <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a></code><a class='srclink' href='../../src/std/path.rs.html#2340-2342' title='goto source code'>[src]</a></h4><div class='docblock'><p>Produces an iterator over the path's components viewed as <a href="../ffi/struct.OsStr.html"><code>OsStr</code></a>
slices.</p>
<p>For more information about the particulars of how the path is separated
into components, see <a href="#method.components"><code>components</code></a>.</p>
<h1 id="examples-28" class="section-header"><a href="#examples-28">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="self">self</span>, <span class="ident">Path</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ffi</span>::<span class="ident">OsStr</span>;

<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">it</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/tmp/foo.txt&quot;</span>).<span class="ident">iter</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="kw-2">&amp;</span><span class="ident">path</span>::<span class="ident">MAIN_SEPARATOR</span>.<span class="ident">to_string</span>())));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;tmp&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>(), <span class="prelude-val">Some</span>(<span class="ident">OsStr</span>::<span class="ident">new</span>(<span class="string">&quot;foo.txt&quot;</span>)));
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">it</span>.<span class="ident">next</span>(), <span class="prelude-val">None</span>)<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7Bself%2C%20Path%7D%3B%0Ause%20std%3A%3Affi%3A%3AOsStr%3B%0A%0Alet%20mut%20it%20%3D%20Path%3A%3Anew(%22%2Ftmp%2Ffoo.txt%22).iter()%3B%0Aassert_eq!(it.next()%2C%20Some(OsStr%3A%3Anew(%26path%3A%3AMAIN_SEPARATOR.to_string())))%3B%0Aassert_eq!(it.next()%2C%20Some(OsStr%3A%3Anew(%22tmp%22)))%3B%0Aassert_eq!(it.next()%2C%20Some(OsStr%3A%3Anew(%22foo.txt%22)))%3B%0Aassert_eq!(it.next()%2C%20None)%0A%7D">Run</a></pre></div>
</div><h4 id='method.display' class="method"><code id='display.v'>pub fn <a href='#method.display' class='fnname'>display</a>(&amp;self) -&gt; <a class="struct" href="../../std/path/struct.Display.html" title="struct std::path::Display">Display</a></code><a class='srclink' href='../../src/std/path.rs.html#2359-2361' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an object that implements <a href="../fmt/trait.Display.html"><code>Display</code></a> for safely printing paths
that may contain non-Unicode data.</p>
<h1 id="examples-29" class="section-header"><a href="#examples-29">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/tmp/foo.rs&quot;</span>);

<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">path</span>.<span class="ident">display</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Ftmp%2Ffoo.rs%22)%3B%0A%0Aprintln!(%22%7B%7D%22%2C%20path.display())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.metadata' class="method"><code id='metadata.v'>pub fn <a href='#method.metadata' class='fnname'>metadata</a>(&amp;self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="struct" href="../../std/fs/struct.Metadata.html" title="struct std::fs::Metadata">Metadata</a>&gt;</code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div><a class='srclink' href='../../src/std/path.rs.html#2382-2384' title='goto source code'>[src]</a></h4><div class='docblock'><p>Queries the file system to get information about a file, directory, etc.</p>
<p>This function will traverse symbolic links to query information about the
destination file.</p>
<p>This is an alias to <a href="../fs/fn.metadata.html"><code>fs::metadata</code></a>.</p>
<h1 id="examples-30" class="section-header"><a href="#examples-30">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/Minas/tirith&quot;</span>);
<span class="kw">let</span> <span class="ident">metadata</span> <span class="op">=</span> <span class="ident">path</span>.<span class="ident">metadata</span>().<span class="ident">expect</span>(<span class="string">&quot;metadata call failed&quot;</span>);
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">metadata</span>.<span class="ident">file_type</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2FMinas%2Ftirith%22)%3B%0Alet%20metadata%20%3D%20path.metadata().expect(%22metadata%20call%20failed%22)%3B%0Aprintln!(%22%7B%3A%3F%7D%22%2C%20metadata.file_type())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.symlink_metadata' class="method"><code id='symlink_metadata.v'>pub fn <a href='#method.symlink_metadata' class='fnname'>symlink_metadata</a>(&amp;self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="struct" href="../../std/fs/struct.Metadata.html" title="struct std::fs::Metadata">Metadata</a>&gt;</code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div><a class='srclink' href='../../src/std/path.rs.html#2402-2404' title='goto source code'>[src]</a></h4><div class='docblock'><p>Queries the metadata about a file without following symlinks.</p>
<p>This is an alias to <a href="../fs/fn.symlink_metadata.html"><code>fs::symlink_metadata</code></a>.</p>
<h1 id="examples-31" class="section-header"><a href="#examples-31">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/Minas/tirith&quot;</span>);
<span class="kw">let</span> <span class="ident">metadata</span> <span class="op">=</span> <span class="ident">path</span>.<span class="ident">symlink_metadata</span>().<span class="ident">expect</span>(<span class="string">&quot;symlink_metadata call failed&quot;</span>);
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">metadata</span>.<span class="ident">file_type</span>());<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2FMinas%2Ftirith%22)%3B%0Alet%20metadata%20%3D%20path.symlink_metadata().expect(%22symlink_metadata%20call%20failed%22)%3B%0Aprintln!(%22%7B%3A%3F%7D%22%2C%20metadata.file_type())%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.canonicalize' class="method"><code id='canonicalize.v'>pub fn <a href='#method.canonicalize' class='fnname'>canonicalize</a>(&amp;self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt;</code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div><a class='srclink' href='../../src/std/path.rs.html#2422-2424' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the canonical, absolute form of the path with all intermediate
components normalized and symbolic links resolved.</p>
<p>This is an alias to <a href="../fs/fn.canonicalize.html"><code>fs::canonicalize</code></a>.</p>
<h1 id="examples-32" class="section-header"><a href="#examples-32">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::{<span class="ident">Path</span>, <span class="ident">PathBuf</span>};

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/foo/test/../test/bar.rs&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">path</span>.<span class="ident">canonicalize</span>().<span class="ident">unwrap</span>(), <span class="ident">PathBuf</span>::<span class="ident">from</span>(<span class="string">&quot;/foo/test/bar.rs&quot;</span>));<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3A%7BPath%2C%20PathBuf%7D%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Ffoo%2Ftest%2F..%2Ftest%2Fbar.rs%22)%3B%0Aassert_eq!(path.canonicalize().unwrap()%2C%20PathBuf%3A%3Afrom(%22%2Ffoo%2Ftest%2Fbar.rs%22))%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.read_link' class="method"><code id='read_link.v'>pub fn <a href='#method.read_link' class='fnname'>read_link</a>(&amp;self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt;</code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div><a class='srclink' href='../../src/std/path.rs.html#2441-2443' title='goto source code'>[src]</a></h4><div class='docblock'><p>Reads a symbolic link, returning the file that the link points to.</p>
<p>This is an alias to <a href="../fs/fn.read_link.html"><code>fs::read_link</code></a>.</p>
<h1 id="examples-33" class="section-header"><a href="#examples-33">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/laputa/sky_castle.rs&quot;</span>);
<span class="kw">let</span> <span class="ident">path_link</span> <span class="op">=</span> <span class="ident">path</span>.<span class="ident">read_link</span>().<span class="ident">expect</span>(<span class="string">&quot;read_link call failed&quot;</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Flaputa%2Fsky_castle.rs%22)%3B%0Alet%20path_link%20%3D%20path.read_link().expect(%22read_link%20call%20failed%22)%3B%0A%7D">Run</a></pre></div>
</div><h4 id='method.read_dir' class="method"><code id='read_dir.v'>pub fn <a href='#method.read_dir' class='fnname'>read_dir</a>(&amp;self) -&gt; <a class="type" href="../../std/io/type.Result.html" title="type std::io::Result">Result</a>&lt;<a class="struct" href="../../std/fs/struct.ReadDir.html" title="struct std::fs::ReadDir">ReadDir</a>&gt;</code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div><a class='srclink' href='../../src/std/path.rs.html#2469-2471' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns an iterator over the entries within a directory.</p>
<p>The iterator will yield instances of <a href="../io/type.Result.html"><code>io::Result</code></a><code>&lt;</code><a href="../fs/struct.DirEntry.html"><code>DirEntry</code></a><code>&gt;</code>. New
errors may be encountered after an iterator is initially constructed.</p>
<p>This is an alias to <a href="../fs/fn.read_dir.html"><code>fs::read_dir</code></a>.</p>
<h1 id="examples-34" class="section-header"><a href="#examples-34">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;

<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;/laputa&quot;</span>);
<span class="kw">for</span> <span class="ident">entry</span> <span class="kw">in</span> <span class="ident">path</span>.<span class="ident">read_dir</span>().<span class="ident">expect</span>(<span class="string">&quot;read_dir call failed&quot;</span>) {
    <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">entry</span>) <span class="op">=</span> <span class="ident">entry</span> {
        <span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">entry</span>.<span class="ident">path</span>());
    }
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0A%0Alet%20path%20%3D%20Path%3A%3Anew(%22%2Flaputa%22)%3B%0Afor%20entry%20in%20path.read_dir().expect(%22read_dir%20call%20failed%22)%20%7B%0A%20%20%20%20if%20let%20Ok(entry)%20%3D%20entry%20%7B%0A%20%20%20%20%20%20%20%20println!(%22%7B%3A%3F%7D%22%2C%20entry.path())%3B%0A%20%20%20%20%7D%0A%7D%0A%7D">Run</a></pre></div>
</div><h4 id='method.exists' class="method"><code id='exists.v'>pub fn <a href='#method.exists' class='fnname'>exists</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div><a class='srclink' href='../../src/std/path.rs.html#2495-2497' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the path points at an existing entity.</p>
<p>This function will traverse symbolic links to query information about the
destination file. In case of broken symbolic links this will return <code>false</code>.</p>
<p>If you cannot access the directory containing the file, e.g., because of a
permission error, this will return <code>false</code>.</p>
<h1 id="examples-35" class="section-header"><a href="#examples-35">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;does_not_exist.txt&quot;</span>).<span class="ident">exists</span>(), <span class="bool-val">false</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0Aassert_eq!(Path%3A%3Anew(%22does_not_exist.txt%22).exists()%2C%20false)%3B%0A%7D">Run</a></pre></div>
<h1 id="see-also" class="section-header"><a href="#see-also">See Also</a></h1>
<p>This is a convenience function that coerces errors to false. If you want to
check errors, call <a href="../../std/fs/fn.metadata.html">fs::metadata</a>.</p>
</div><h4 id='method.is_file' class="method"><code id='is_file.v'>pub fn <a href='#method.is_file' class='fnname'>is_file</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div><a class='srclink' href='../../src/std/path.rs.html#2524-2526' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the path exists on disk and is pointing at a regular file.</p>
<p>This function will traverse symbolic links to query information about the
destination file. In case of broken symbolic links this will return <code>false</code>.</p>
<p>If you cannot access the directory containing the file, e.g., because of a
permission error, this will return <code>false</code>.</p>
<h1 id="examples-36" class="section-header"><a href="#examples-36">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;./is_a_directory/&quot;</span>).<span class="ident">is_file</span>(), <span class="bool-val">false</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;a_file.txt&quot;</span>).<span class="ident">is_file</span>(), <span class="bool-val">true</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0Aassert_eq!(Path%3A%3Anew(%22.%2Fis_a_directory%2F%22).is_file()%2C%20false)%3B%0Aassert_eq!(Path%3A%3Anew(%22a_file.txt%22).is_file()%2C%20true)%3B%0A%7D">Run</a></pre></div>
<h1 id="see-also-1" class="section-header"><a href="#see-also-1">See Also</a></h1>
<p>This is a convenience function that coerces errors to false. If you want to
check errors, call <a href="../../std/fs/fn.metadata.html">fs::metadata</a> and handle its Result. Then call
<a href="../../std/fs/struct.Metadata.html#method.is_file">fs::Metadata::is_file</a> if it was Ok.</p>
</div><h4 id='method.is_dir' class="method"><code id='is_dir.v'>pub fn <a href='#method.is_dir' class='fnname'>is_dir</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div><a class='srclink' href='../../src/std/path.rs.html#2553-2555' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns <code>true</code> if the path exists on disk and is pointing at a directory.</p>
<p>This function will traverse symbolic links to query information about the
destination file. In case of broken symbolic links this will return <code>false</code>.</p>
<p>If you cannot access the directory containing the file, e.g., because of a
permission error, this will return <code>false</code>.</p>
<h1 id="examples-37" class="section-header"><a href="#examples-37">Examples</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;./is_a_directory/&quot;</span>).<span class="ident">is_dir</span>(), <span class="bool-val">true</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">Path</span>::<span class="ident">new</span>(<span class="string">&quot;a_file.txt&quot;</span>).<span class="ident">is_dir</span>(), <span class="bool-val">false</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Apath%3A%3APath%3B%0Aassert_eq!(Path%3A%3Anew(%22.%2Fis_a_directory%2F%22).is_dir()%2C%20true)%3B%0Aassert_eq!(Path%3A%3Anew(%22a_file.txt%22).is_dir()%2C%20false)%3B%0A%7D">Run</a></pre></div>
<h1 id="see-also-2" class="section-header"><a href="#see-also-2">See Also</a></h1>
<p>This is a convenience function that coerces errors to false. If you want to
check errors, call <a href="../../std/fs/fn.metadata.html">fs::metadata</a> and handle its Result. Then call
<a href="../../std/fs/struct.Metadata.html#method.is_dir">fs::Metadata::is_dir</a> if it was Ok.</p>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Deref' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/ops/trait.Deref.html" title="trait std::ops::Deref">Deref</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1566-1572' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='../../std/ops/trait.Deref.html#associatedtype.Target' class="type">Target</a> = <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='../../std/ops/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a class='srclink' href='../../src/std/path.rs.html#1569-1571' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1559-1563' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='../../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, formatter: &amp;mut <a class="struct" href="../../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="../../std/fmt/type.Result.html" title="type std::fmt::Result">Result</a></code><a class='srclink' href='../../src/std/path.rs.html#1560-1562' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="../../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id='impl-PartialEq%3CPathBuf%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialEq%3CPathBuf%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1672-1676' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#1673-1675' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class="method"><code id='ne.v'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CPath%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialEq%3CPath%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../../src/std/path.rs.html#2722-2725' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-1' class="method hidden"><code id='eq.v-1'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2724' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-1' class="method"><code id='ne.v-1'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CPathBuf%3E-1' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a href='#impl-PartialEq%3CPathBuf%3E-1' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../../src/std/path.rs.html#2728-2731' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-2' class="method hidden"><code id='eq.v-2'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2730' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-2' class="method"><code id='ne.v-2'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3C%26%27a%20Path%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;&amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialEq%3C%26%27a%20Path%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../../src/std/path.rs.html#2722-2725' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-3' class="method hidden"><code id='eq.v-3'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;&amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2724' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-3' class="method"><code id='ne.v-3'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CPathBuf%3E-2' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for &amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a href='#impl-PartialEq%3CPathBuf%3E-2' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../../src/std/path.rs.html#2728-2731' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-4' class="method hidden"><code id='eq.v-4'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2730' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-4' class="method"><code id='ne.v-4'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CPathBuf%3E-3' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a href='#impl-PartialEq%3CPathBuf%3E-3' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../../src/std/path.rs.html#2722-2725' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-5' class="method hidden"><code id='eq.v-5'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2724' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-5' class="method"><code id='ne.v-5'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CCow%3C%27a%2C%20Path%3E%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialEq%3CCow%3C%27a%2C%20Path%3E%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../../src/std/path.rs.html#2728-2731' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-6' class="method hidden"><code id='eq.v-6'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2730' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-6' class="method"><code id='ne.v-6'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3COsStr%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialEq%3COsStr%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2760-2763' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-7' class="method hidden"><code id='eq.v-7'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2762' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-7' class="method"><code id='ne.v-7'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CPathBuf%3E-4' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a></code><a href='#impl-PartialEq%3CPathBuf%3E-4' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2766-2769' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-8' class="method hidden"><code id='eq.v-8'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2768' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-8' class="method"><code id='ne.v-8'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3C%26%27a%20OsStr%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;&amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialEq%3C%26%27a%20OsStr%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2760-2763' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-9' class="method hidden"><code id='eq.v-9'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;&amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2762' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-9' class="method"><code id='ne.v-9'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CPathBuf%3E-5' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for &amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a></code><a href='#impl-PartialEq%3CPathBuf%3E-5' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2766-2769' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-10' class="method hidden"><code id='eq.v-10'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2768' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-10' class="method"><code id='ne.v-10'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CCow%3C%27a%2C%20OsStr%3E%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialEq%3CCow%3C%27a%2C%20OsStr%3E%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2760-2763' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-11' class="method hidden"><code id='eq.v-11'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2762' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-11' class="method"><code id='ne.v-11'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CPathBuf%3E-6' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;</code><a href='#impl-PartialEq%3CPathBuf%3E-6' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2766-2769' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-12' class="method hidden"><code id='eq.v-12'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2768' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-12' class="method"><code id='ne.v-12'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3COsString%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialEq%3COsString%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2760-2763' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-13' class="method hidden"><code id='eq.v-13'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2762' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-13' class="method"><code id='ne.v-13'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-PartialEq%3CPathBuf%3E-7' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code><a href='#impl-PartialEq%3CPathBuf%3E-7' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2766-2769' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq-14' class="method hidden"><code id='eq.v-14'>fn <a href='../../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/std/path.rs.html#2768' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne-14' class="method"><code id='ne.v-14'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#200' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/cmp/trait.Eq.html" title="trait std::cmp::Eq">Eq</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1686' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Ord' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Ord' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1696-1700' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.cmp' class="method hidden"><code id='cmp.v'>fn <a href='../../std/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a></code><a class='srclink' href='../../src/std/path.rs.html#1697-1699' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an <code>Ordering</code> between <code>self</code> and <code>other</code>. <a href="../../std/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id='method.max' class="method"><code id='max.v'>fn <a href='../../std/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -&gt; Self</code><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../../src/core/cmp.rs.html#549-552' title='goto source code'>[src]</a></h4><div class='docblock'><p>Compares and returns the maximum of two values. <a href="../../std/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id='method.min' class="method"><code id='min.v'>fn <a href='../../std/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -&gt; Self</code><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../../src/core/cmp.rs.html#566-569' title='goto source code'>[src]</a></h4><div class='docblock'><p>Compares and returns the minimum of two values. <a href="../../std/cmp/trait.Ord.html#method.min">Read more</a></p>
</div><h4 id='method.clamp' class="method"><code id='clamp.v'>fn <a href='../../std/cmp/trait.Ord.html#method.clamp' class='fnname'>clamp</a>(self, min: Self, max: Self) -&gt; Self</code><a class='srclink' href='../../src/core/cmp.rs.html#590-600' title='goto source code'>[src]</a></h4><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>clamp</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/44095">#44095</a>)</div></div><div class='docblock'><p>Restrict a value to a certain interval. <a href="../../std/cmp/trait.Ord.html#method.clamp">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPathBuf%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialOrd%3CPathBuf%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1689-1693' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp' class="method hidden"><code id='partial_cmp.v'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1690-1692' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt' class="method"><code id='lt.v'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class="method"><code id='le.v'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt' class="method"><code id='gt.v'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge' class="method"><code id='ge.v'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPath%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialOrd%3CPath%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2734-2739' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-1' class="method hidden"><code id='partial_cmp.v-1'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2736-2738' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-1' class="method"><code id='lt.v-1'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-1' class="method"><code id='le.v-1'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-1' class="method"><code id='gt.v-1'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-1' class="method"><code id='ge.v-1'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPathBuf%3E-1' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a href='#impl-PartialOrd%3CPathBuf%3E-1' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2742-2747' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-2' class="method hidden"><code id='partial_cmp.v-2'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2744-2746' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-2' class="method"><code id='lt.v-2'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-2' class="method"><code id='le.v-2'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-2' class="method"><code id='gt.v-2'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-2' class="method"><code id='ge.v-2'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3C%26%27a%20Path%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;&amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialOrd%3C%26%27a%20Path%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2734-2739' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-3' class="method hidden"><code id='partial_cmp.v-3'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;&amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2736-2738' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-3' class="method"><code id='lt.v-3'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-3' class="method"><code id='le.v-3'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-3' class="method"><code id='gt.v-3'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-3' class="method"><code id='ge.v-3'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPathBuf%3E-2' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for &amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a href='#impl-PartialOrd%3CPathBuf%3E-2' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2742-2747' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-4' class="method hidden"><code id='partial_cmp.v-4'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2744-2746' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-4' class="method"><code id='lt.v-4'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-4' class="method"><code id='le.v-4'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-4' class="method"><code id='gt.v-4'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-4' class="method"><code id='ge.v-4'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPathBuf%3E-3' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a href='#impl-PartialOrd%3CPathBuf%3E-3' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2734-2739' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-5' class="method hidden"><code id='partial_cmp.v-5'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2736-2738' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-5' class="method"><code id='lt.v-5'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-5' class="method"><code id='le.v-5'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-5' class="method"><code id='gt.v-5'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-5' class="method"><code id='ge.v-5'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CCow%3C%27a%2C%20Path%3E%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialOrd%3CCow%3C%27a%2C%20Path%3E%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2742-2747' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-6' class="method hidden"><code id='partial_cmp.v-6'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2744-2746' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-6' class="method"><code id='lt.v-6'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-6' class="method"><code id='le.v-6'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-6' class="method"><code id='gt.v-6'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-6' class="method"><code id='ge.v-6'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3COsStr%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialOrd%3COsStr%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2772-2777' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-7' class="method hidden"><code id='partial_cmp.v-7'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2774-2776' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-7' class="method"><code id='lt.v-7'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-7' class="method"><code id='le.v-7'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-7' class="method"><code id='gt.v-7'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-7' class="method"><code id='ge.v-7'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPathBuf%3E-4' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a></code><a href='#impl-PartialOrd%3CPathBuf%3E-4' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2780-2785' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-8' class="method hidden"><code id='partial_cmp.v-8'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2782-2784' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-8' class="method"><code id='lt.v-8'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-8' class="method"><code id='le.v-8'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-8' class="method"><code id='gt.v-8'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-8' class="method"><code id='ge.v-8'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3C%26%27a%20OsStr%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;&amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialOrd%3C%26%27a%20OsStr%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2772-2777' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-9' class="method hidden"><code id='partial_cmp.v-9'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;&amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2774-2776' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-9' class="method"><code id='lt.v-9'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-9' class="method"><code id='le.v-9'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-9' class="method"><code id='gt.v-9'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-9' class="method"><code id='ge.v-9'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPathBuf%3E-5' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for &amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a></code><a href='#impl-PartialOrd%3CPathBuf%3E-5' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2780-2785' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-10' class="method hidden"><code id='partial_cmp.v-10'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2782-2784' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-10' class="method"><code id='lt.v-10'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-10' class="method"><code id='le.v-10'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-10' class="method"><code id='gt.v-10'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-10' class="method"><code id='ge.v-10'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CCow%3C%27a%2C%20OsStr%3E%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialOrd%3CCow%3C%27a%2C%20OsStr%3E%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2772-2777' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-11' class="method hidden"><code id='partial_cmp.v-11'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2774-2776' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-11' class="method"><code id='lt.v-11'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-11' class="method"><code id='le.v-11'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-11' class="method"><code id='gt.v-11'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-11' class="method"><code id='ge.v-11'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPathBuf%3E-6' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;</code><a href='#impl-PartialOrd%3CPathBuf%3E-6' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2780-2785' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-12' class="method hidden"><code id='partial_cmp.v-12'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2782-2784' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-12' class="method"><code id='lt.v-12'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-12' class="method"><code id='le.v-12'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-12' class="method"><code id='gt.v-12'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-12' class="method"><code id='ge.v-12'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3COsString%3E' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-PartialOrd%3COsString%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2772-2777' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-13' class="method hidden"><code id='partial_cmp.v-13'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2774-2776' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-13' class="method"><code id='lt.v-13'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-13' class="method"><code id='le.v-13'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-13' class="method"><code id='gt.v-13'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-13' class="method"><code id='ge.v-13'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-PartialOrd%3CPathBuf%3E-7' class='impl'><code class='in-band'>impl&lt;'a, 'b&gt; <a class="trait" href="../../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code><a href='#impl-PartialOrd%3CPathBuf%3E-7' class='anchor'></a><div class='since' title='Stable since Rust version 1.8.0'>1.8.0</div><a class='srclink' href='../../src/std/path.rs.html#2780-2785' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.partial_cmp-14' class="method hidden"><code id='partial_cmp.v-14'>fn <a href='../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;<a class="enum" href="../../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2782-2784' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt-14' class="method"><code id='lt.v-14'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#772-777' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le-14' class="method"><code id='le.v-14'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#794-799' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt-14' class="method"><code id='gt.v-14'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#815-820' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge-14' class="method"><code id='ge.v-14'><div class="docblock attributes">#[must_use]
</div>fn <a href='../../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: <a class="primitive" href="../primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="../primitive.bool.html">bool</a></code><a class='srclink' href='../../src/core/cmp.rs.html#837-842' title='goto source code'>[src]</a></h4><div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="../../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='impl-FromStr' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/str/trait.FromStr.html" title="trait std::str::FromStr">FromStr</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-FromStr' class='anchor'></a><div class='since' title='Stable since Rust version 1.32.0'>1.32.0</div><a class='srclink' href='../../src/std/path.rs.html#1534-1540' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Err' class="type"><code id='Err.t'>type <a href='../../std/str/trait.FromStr.html#associatedtype.Err' class="type">Err</a> = <a class="enum" href="../../std/convert/enum.Infallible.html" title="enum std::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The associated error which can be returned from parsing.</p>
</div><h4 id='method.from_str' class="method hidden"><code id='from_str.v'>fn <a href='../../std/str/trait.FromStr.html#tymethod.from_str' class='fnname'>from_str</a>(s: &amp;<a class="primitive" href="../primitive.str.html">str</a>) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;Self, Self::<a class="type" href="../../std/str/trait.FromStr.html#associatedtype.Err" title="type std::str::FromStr::Err">Err</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1537-1539' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Parses a string <code>s</code> to return a value of this type. <a href="../../std/str/trait.FromStr.html#tymethod.from_str">Read more</a></p>
</div></div><h3 id='impl-From%3CBox%3CPath%3E%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-From%3CBox%3CPath%3E%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.18.0'>1.18.0</div><a class='srclink' href='../../src/std/path.rs.html#1468-1475' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method"><code id='from.v'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(boxed: <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1472-1474' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a <code>Box&lt;Path&gt;</code> into a <code>PathBuf</code></p>
<p>This conversion does not allocate or copy memory.</p>
</div></div><h3 id='impl-From%3CPathBuf%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a href='#impl-From%3CPathBuf%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.20.0'>1.20.0</div><a class='srclink' href='../../src/std/path.rs.html#1478-1486' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-1' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;I&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;I&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;I&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;I&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;F&gt; <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>&gt; <a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;R&gt;</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>&gt; <a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;W&gt;</span></code></div></div><code id='from.v-1'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(p: <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1483-1485' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a <code>PathBuf</code> into a <code>Box&lt;Path&gt;</code></p>
<p>This conversion currently should not allocate memory,
but this behavior is not guaranteed on all platforms or in all future versions.</p>
</div></div><h3 id='impl-From%3C%26%27_%20T%3E' class='impl'><code class='in-band'>impl&lt;T:&nbsp;?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a> + <a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;, '_&gt; <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="primitive" href="../primitive.reference.html">&amp;'_ </a>T&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-From%3C%26%27_%20T%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1497-1501' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-2' class="method hidden"><code id='from.v-2'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: <a class="primitive" href="../primitive.reference.html">&amp;</a>T) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1498-1500' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3COsString%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-From%3COsString%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1504-1511' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-3' class="method"><code id='from.v-3'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a>) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1508-1510' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a <code>OsString</code> into a <code>PathBuf</code></p>
<p>This conversion does not allocate or copy memory.</p>
</div></div><h3 id='impl-From%3CPathBuf%3E-1' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code><a href='#impl-From%3CPathBuf%3E-1' class='anchor'></a><div class='since' title='Stable since Rust version 1.14.0'>1.14.0</div><a class='srclink' href='../../src/std/path.rs.html#1514-1521' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-4' class="method"><code id='from.v-4'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(path_buf: <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code><a class='srclink' href='../../src/std/path.rs.html#1518-1520' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a <code>PathBuf</code> into a <code>OsString</code></p>
<p>This conversion does not allocate or copy memory.</p>
</div></div><h3 id='impl-From%3CString%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-From%3CString%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1524-1531' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-5' class="method"><code id='from.v-5'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a>) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1528-1530' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a <code>String</code> into a <code>PathBuf</code></p>
<p>This conversion does not allocate or copy memory.</p>
</div></div><h3 id='impl-From%3CPathBuf%3E-2' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a href='#impl-From%3CPathBuf%3E-2' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../../src/std/path.rs.html#1597-1602' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-6' class="method hidden"><code id='from.v-6'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1599-1601' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3C%26%27a%20PathBuf%3E' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;&amp;'a <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a href='#impl-From%3C%26%27a%20PathBuf%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.28.0'>1.28.0</div><a class='srclink' href='../../src/std/path.rs.html#1605-1610' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-7' class="method hidden"><code id='from.v-7'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(p: &amp;'a <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1607-1609' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3CCow%3C%27a%2C%20Path%3E%3E' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-From%3CCow%3C%27a%2C%20Path%3E%3E' class='anchor'></a><div class='since' title='Stable since Rust version 1.28.0'>1.28.0</div><a class='srclink' href='../../src/std/path.rs.html#1613-1618' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-8' class="method hidden"><code id='from.v-8'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(p: <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;) -&gt; Self</code><a class='srclink' href='../../src/std/path.rs.html#1615-1617' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3CPathBuf%3E-3' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/sync/struct.Arc.html" title="struct std::sync::Arc">Arc</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a href='#impl-From%3CPathBuf%3E-3' class='anchor'></a><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../../src/std/path.rs.html#1621-1628' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-9' class="method"><code id='from.v-9'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="struct" href="../../std/sync/struct.Arc.html" title="struct std::sync::Arc">Arc</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1624-1627' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a Path into a Rc by copying the Path data into a new Rc buffer.</p>
</div></div><h3 id='impl-From%3CPathBuf%3E-4' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/rc/struct.Rc.html" title="struct std::rc::Rc">Rc</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a href='#impl-From%3CPathBuf%3E-4' class='anchor'></a><div class='since' title='Stable since Rust version 1.24.0'>1.24.0</div><a class='srclink' href='../../src/std/path.rs.html#1641-1648' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-10' class="method"><code id='from.v-10'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(s: <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -&gt; <a class="struct" href="../../std/rc/struct.Rc.html" title="struct std::rc::Rc">Rc</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code><a class='srclink' href='../../src/std/path.rs.html#1644-1647' title='goto source code'>[src]</a></h4><div class='docblock'><p>Converts a Path into a Rc by copying the Path data into a new Rc buffer.</p>
</div></div><h3 id='impl-Hash' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/hash/trait.Hash.html" title="trait std::hash::Hash">Hash</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Hash' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1679-1683' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.hash' class="method hidden"><code id='hash.v'>fn <a href='../../std/hash/trait.Hash.html#tymethod.hash' class='fnname'>hash</a>&lt;H:&nbsp;<a class="trait" href="../../std/hash/trait.Hasher.html" title="trait std::hash::Hasher">Hasher</a>&gt;(&amp;self, h: <a class="primitive" href="../primitive.reference.html">&amp;mut </a>H)</code><a class='srclink' href='../../src/std/path.rs.html#1680-1682' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given [<code>Hasher</code>]. <a href="../../std/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id='method.hash_slice' class="method"><code id='hash_slice.v'>fn <a href='../../std/hash/trait.Hash.html#method.hash_slice' class='fnname'>hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="../primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="../primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="../../std/hash/trait.Hasher.html" title="trait std::hash::Hasher">Hasher</a>,&nbsp;</span></code><div class='since' title='Stable since Rust version 1.3.0'>1.3.0</div><a class='srclink' href='../../src/core/hash/mod.rs.html#193-199' title='goto source code'>[src]</a></h4><div class='docblock'><p>Feeds a slice of this type into the given [<code>Hasher</code>]. <a href="../../std/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id='impl-FromIterator%3CP%3E' class='impl'><code class='in-band'>impl&lt;P:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt; <a class="trait" href="../../std/iter/trait.FromIterator.html" title="trait std::iter::FromIterator">FromIterator</a>&lt;P&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-FromIterator%3CP%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1543-1549' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from_iter' class="method hidden"><code id='from_iter.v'>fn <a href='../../std/iter/trait.FromIterator.html#tymethod.from_iter' class='fnname'>from_iter</a>&lt;I:&nbsp;<a class="trait" href="../../std/iter/trait.IntoIterator.html" title="trait std::iter::IntoIterator">IntoIterator</a>&lt;Item = P&gt;&gt;(iter: I) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1544-1548' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates a value from an iterator. <a href="../../std/iter/trait.FromIterator.html#tymethod.from_iter">Read more</a></p>
</div></div><h3 id='impl-IntoIterator' class='impl'><code class='in-band'>impl&lt;'a&gt; <a class="trait" href="../../std/iter/trait.IntoIterator.html" title="trait std::iter::IntoIterator">IntoIterator</a> for &amp;'a <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-IntoIterator' class='anchor'></a><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div><a class='srclink' href='../../src/std/path.rs.html#2706-2710' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Item' class="type"><code id='Item.t'>type <a href='../../std/iter/trait.IntoIterator.html#associatedtype.Item' class="type">Item</a> = &amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a></code></h4><div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='associatedtype.IntoIter' class="type"><code id='IntoIter.t'>type <a href='../../std/iter/trait.IntoIterator.html#associatedtype.IntoIter' class="type">IntoIter</a> = <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a>&lt;'a&gt;</code></h4><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
</div><h4 id='method.into_iter' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a>&lt;'a&gt;</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a>&lt;'a&gt;</h3><code class="content"><span class="where fmt-newline">impl&lt;'a&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a>&lt;'a&gt;</span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>;</span></code></div></div><code id='into_iter.v'>fn <a href='../../std/iter/trait.IntoIterator.html#tymethod.into_iter' class='fnname'>into_iter</a>(self) -&gt; <a class="struct" href="../../std/path/struct.Iter.html" title="struct std::path::Iter">Iter</a>&lt;'a&gt;</code><a class='srclink' href='../../src/std/path.rs.html#2709' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates an iterator from a value. <a href="../../std/iter/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
</div></div><h3 id='impl-Extend%3CP%3E' class='impl'><code class='in-band'>impl&lt;P:&nbsp;<a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt; <a class="trait" href="../../std/iter/trait.Extend.html" title="trait std::iter::Extend">Extend</a>&lt;P&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Extend%3CP%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1552-1556' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.extend' class="method hidden"><code id='extend.v'>fn <a href='../../std/iter/trait.Extend.html#tymethod.extend' class='fnname'>extend</a>&lt;I:&nbsp;<a class="trait" href="../../std/iter/trait.IntoIterator.html" title="trait std::iter::IntoIterator">IntoIterator</a>&lt;Item = P&gt;&gt;(&amp;mut self, iter: I)</code><a class='srclink' href='../../src/std/path.rs.html#1553-1555' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Extends a collection with the contents of an iterator. <a href="../../std/iter/trait.Extend.html#tymethod.extend">Read more</a></p>
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1122' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='../../std/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a class='srclink' href='../../src/std/path.rs.html#1122' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="../../std/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='../../std/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="../primitive.reference.html">&amp;</a>Self)</code><a class='srclink' href='../../src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="../../std/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id='impl-AsRef%3COsStr%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-AsRef%3COsStr%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1703-1707' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_ref' class="method hidden"><code id='as_ref.v'>fn <a href='../../std/convert/trait.AsRef.html#tymethod.as_ref' class='fnname'>as_ref</a>(&amp;self) -&gt; &amp;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a></code><a class='srclink' href='../../src/std/path.rs.html#1704-1706' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-AsRef%3CPath%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-AsRef%3CPath%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#2699-2703' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.as_ref-1' class="method hidden"><code id='as_ref.v-1'>fn <a href='../../std/convert/trait.AsRef.html#tymethod.as_ref' class='fnname'>as_ref</a>(&amp;self) -&gt; &amp;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a class='srclink' href='../../src/std/path.rs.html#2700-2702' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/default/trait.Default.html" title="trait std::default::Default">Default</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Default' class='anchor'></a><div class='since' title='Stable since Rust version 1.17.0'>1.17.0</div><a class='srclink' href='../../src/std/path.rs.html#1582-1586' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='../../std/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; Self</code><a class='srclink' href='../../src/std/path.rs.html#1583-1585' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the &quot;default value&quot; for a type. <a href="../../std/default/trait.Default.html#tymethod.default">Read more</a></p>
</div></div><h3 id='impl-Borrow%3CPath%3E' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Borrow%3CPath%3E' class='anchor'></a><a class='srclink' href='../../src/std/path.rs.html#1575-1579' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='../../std/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; &amp;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a class='srclink' href='../../src/std/path.rs.html#1576-1578' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="../../std/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-TryFrom' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom' class='anchor'></a><a class='srclink' href='../../src/core/convert.rs.html#565-571' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='../../std/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="../../std/convert/enum.Infallible.html" title="enum std::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='../../std/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="../../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='../../src/core/convert.rs.html#568-570' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a> for T</code><a href='#impl-From' class='anchor'></a><a class='srclink' href='../../src/core/convert.rs.html#546-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from-11' class="method hidden"><code id='from.v-11'>fn <a href='../../std/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='../../src/core/convert.rs.html#547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../std/convert/trait.TryInto.html" title="trait std::convert::TryInto">TryInto</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto' class='anchor'></a><a class='srclink' href='../../src/core/convert.rs.html#553-560' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='../../std/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='../../std/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -&gt; <a class="enum" href="../../std/result/enum.Result.html" title="enum std::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="../../std/convert/trait.TryFrom.html" title="trait std::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="../../std/convert/trait.TryFrom.html#associatedtype.Error" title="type std::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='../../src/core/convert.rs.html#557-559' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Into' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="../../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="../../std/convert/trait.From.html" title="trait std::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into' class='anchor'></a><a class='srclink' href='../../src/core/convert.rs.html#537-542' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='../../std/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='../../src/core/convert.rs.html#539-541' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-Borrow' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/borrow/trait.Borrow.html" title="trait std::borrow::Borrow">Borrow</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow' class='anchor'></a><a class='srclink' href='../../src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow-1' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl&lt;'_, F&gt; <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;'_, I&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>R</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>W</span></code></div></div><code id='borrow.v-1'>fn <a href='../../std/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; <a class="primitive" href="../primitive.reference.html">&amp;</a>T</code><a class='srclink' href='../../src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="../../std/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-BorrowMut' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/borrow/trait.BorrowMut.html" title="trait std::borrow::BorrowMut">BorrowMut</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut' class='anchor'></a><a class='srclink' href='../../src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F</h3><code class="content"><span class="where fmt-newline">impl&lt;'_, F&gt; <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="../../std/marker/trait.Unpin.html" title="trait std::marker::Unpin">Unpin</a> + <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/future/trait.Future.html#associatedtype.Output' class="type">Output</a> = &lt;F as <a class="trait" href="../../std/future/trait.Future.html" title="trait std::future::Future">Future</a>&gt;::<a class="type" href="../../std/future/trait.Future.html#associatedtype.Output" title="type std::future::Future::Output">Output</a>;</span><span class="where fmt-newline">impl&lt;'_, I&gt; <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>I <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></span><span class="where fmt-newline">    type <a href='../../std/iter/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = &lt;I as <a class="trait" href="../../std/iter/trait.Iterator.html" title="trait std::iter::Iterator">Iterator</a>&gt;::<a class="type" href="../../std/iter/trait.Iterator.html#associatedtype.Item" title="type std::iter::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl&lt;R:&nbsp;<a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../../std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>R</span><span class="where fmt-newline">impl&lt;W:&nbsp;<a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>, '_&gt; <a class="trait" href="../../std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="../primitive.reference.html">&amp;'_ mut </a>W</span></code></div></div><code id='borrow_mut.v'>fn <a href='../../std/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="../primitive.reference.html">&amp;mut </a>T</code><a class='srclink' href='../../src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="../../std/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/any/trait.Any.html" title="trait std::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='../../src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='../../std/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="../../std/any/struct.TypeId.html" title="struct std::any::TypeId">TypeId</a></code><a class='srclink' href='../../src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="../../std/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="../../std/borrow/trait.ToOwned.html" title="trait std::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='../../src/alloc/borrow.rs.html#80-91' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='../../std/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='../../std/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&amp;self) -&gt; T</code><a class='srclink' href='../../src/alloc/borrow.rs.html#84-86' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="../../std/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4 id='method.clone_into' class="method hidden"><code id='clone_into.v'>fn <a href='../../std/borrow/trait.ToOwned.html#method.clone_into' class='fnname'>clone_into</a>(&amp;self, target: <a class="primitive" href="../primitive.reference.html">&amp;mut </a>T)</code><a class='srclink' href='../../src/alloc/borrow.rs.html#88-90' title='goto source code'>[src]</a></h4><div class='stability hidden'><div class='stab unstable'><details><summary><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/41263">#41263</a>)</summary><p>recently added</p>
</details></div></div><div class='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="../../std/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "std";</script><script src="../../aliases.js"></script><script src="../../main1.35.0.js"></script><script defer src="../../search-index.js"></script></body></html>