146 lines
No EOL
22 KiB
HTML
146 lines
No EOL
22 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `NixPath` trait in crate `nix`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, NixPath">
|
||
|
||
<title>nix::NixPath - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../normalize.css">
|
||
<link rel="stylesheet" type="text/css" href="../rustdoc.css"
|
||
id="mainThemeStyle">
|
||
|
||
<link rel="stylesheet" type="text/css" href="../dark.css">
|
||
<link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
|
||
<script src="../storage.js"></script>
|
||
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc trait">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
<div class="sidebar-menu">☰</div>
|
||
|
||
<p class='location'>Trait NixPath</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.len">len</a><a href="#tymethod.with_nix_path">with_nix_path</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-NixPath">str</a><a href="#impl-NixPath">OsStr</a><a href="#impl-NixPath">CStr</a><a href="#impl-NixPath">[u8]</a><a href="#impl-NixPath">Path</a><a href="#impl-NixPath">PathBuf</a><a href="#impl-NixPath">Option<&'a NP></a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>nix</a></p><script>window.sidebarCurrent = {name: 'NixPath', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
|
||
</nav>
|
||
|
||
<div class="theme-picker">
|
||
<button id="theme-picker" aria-label="Pick another theme!">
|
||
<img src="../brush.svg" width="18" alt="Pick another theme!">
|
||
</button>
|
||
<div id="theme-choices"></div>
|
||
</div>
|
||
<script src="../theme.js"></script>
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content"><h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>nix</a>::<wbr><a class="trait" href=''>NixPath</a></span><span class='out-of-band'><span id='render-detail'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a class='srclink' href='../src/nix/lib.rs.html#140-145' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust trait'>pub trait NixPath {
|
||
fn <a href='#tymethod.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
|
||
<div class='item-spacer'></div> fn <a href='#tymethod.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T><br> <span class="where">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T</span>;
|
||
}</pre></div>
|
||
<h2 id='required-methods' class='small-section-header'>
|
||
Required Methods<a href='#required-methods' class='anchor'></a>
|
||
</h2>
|
||
<div class='methods'>
|
||
<h3 id='tymethod.len' class='method'><span id='len.v' class='invisible'><code>fn <a href='#tymethod.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></h3><h3 id='tymethod.with_nix_path' class='method'><span id='with_nix_path.v' class='invisible'><code>fn <a href='#tymethod.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T, </span></code></span></h3></div>
|
||
<h2 id='foreign-impls' class='small-section-header'>
|
||
Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
|
||
</h2>
|
||
<h3 id='impl-NixPath' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../nix/trait.NixPath.html" title="trait nix::NixPath">NixPath</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><a href='#impl-NixPath' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#147-156' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='method.len' class="method"><span id='len.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#148-150' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.with_nix_path' class="method"><span id='with_nix_path.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#152-155' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-NixPath-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../nix/trait.NixPath.html" title="trait nix::NixPath">NixPath</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/os_str/struct.OsStr.html" title="struct std::ffi::os_str::OsStr">OsStr</a></code><a href='#impl-NixPath-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#158-167' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='method.len-1' class="method"><span id='len.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#159-161' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.with_nix_path-1' class="method"><span id='with_nix_path.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#163-166' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-NixPath-2' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../nix/trait.NixPath.html" title="trait nix::NixPath">NixPath</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a></code><a href='#impl-NixPath-2' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#169-183' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='method.len-2' class="method"><span id='len.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#170-172' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.with_nix_path-2' class="method"><span id='with_nix_path.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#174-182' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-NixPath-3' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../nix/trait.NixPath.html" title="trait nix::NixPath">NixPath</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><a href='#impl-NixPath-3' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#185-210' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='method.len-3' class="method"><span id='len.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#186-188' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.with_nix_path-3' class="method"><span id='with_nix_path.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#190-209' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-NixPath-4' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../nix/trait.NixPath.html" title="trait nix::NixPath">NixPath</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a></code><a href='#impl-NixPath-4' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#212-220' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='method.len-4' class="method"><span id='len.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#213-215' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.with_nix_path-4' class="method"><span id='with_nix_path.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#217-219' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-NixPath-5' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../nix/trait.NixPath.html" title="trait nix::NixPath">NixPath</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code><a href='#impl-NixPath-5' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#222-230' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='method.len-5' class="method"><span id='len.v-6' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#223-225' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.with_nix_path-5' class="method"><span id='with_nix_path.v-6' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#227-229' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span><h3 id='impl-NixPath-6' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<'a, NP: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="../nix/trait.NixPath.html" title="trait nix::NixPath">NixPath</a>> <a class="trait" href="../nix/trait.NixPath.html" title="trait nix::NixPath">NixPath</a> for <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a </a>NP></code><a href='#impl-NixPath-6' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#233-245' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='docblock'><p>Treats <code>None</code> as an empty string.</p>
|
||
</div><span class='docblock autohide'><div class='impl-items'><h4 id='method.len-6' class="method"><span id='len.v-7' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#234-236' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.with_nix_path-6' class="method"><span id='with_nix_path.v-7' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with_nix_path' class='fnname'>with_nix_path</a><T, F>(&self, f: F) -> <a class="type" href="../nix/type.Result.html" title="type nix::Result">Result</a><T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="https://doc.rust-lang.org/nightly/std/ffi/c_str/struct.CStr.html" title="struct std::ffi::c_str::CStr">CStr</a>) -> T, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/nix/lib.rs.html#238-244' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span>
|
||
<h2 id='implementors' class='small-section-header'>
|
||
Implementors<a href='#implementors' class='anchor'></a>
|
||
</h2>
|
||
<ul class='item-list' id='implementors-list'>
|
||
</ul><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
|
||
src="../implementors/nix/trait.NixPath.js">
|
||
</script></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>⏎</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>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../";
|
||
window.currentCrate = "nix";
|
||
</script>
|
||
<script src="../main.js"></script>
|
||
<script defer src="../search-index.js"></script>
|
||
</body>
|
||
</html> |