Skip to content

Commit 4c53c2a

Browse files
Deploying to gh-pages from @ 63f98bb 🚀
1 parent 73b10ac commit 4c53c2a

File tree

152 files changed

+17687
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+17687
-203
lines changed

api/camino/all.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><title>List of all items in this crate</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="camino" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0-nightly (b19329a37 2024-11-21)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../camino/index.html">camino</a><span class="version">1.1.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h3><a href="#structs">Crate Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><h1>List of all items</h1><h3 id="structs">Structs</h3><ul class="all-items"><li><a href="struct.FromPathBufError.html">FromPathBufError</a></li><li><a href="struct.FromPathError.html">FromPathError</a></li><li><a href="struct.Iter.html">Iter</a></li><li><a href="struct.ReadDirUtf8.html">ReadDirUtf8</a></li><li><a href="struct.Utf8Ancestors.html">Utf8Ancestors</a></li><li><a href="struct.Utf8Components.html">Utf8Components</a></li><li><a href="struct.Utf8DirEntry.html">Utf8DirEntry</a></li><li><a href="struct.Utf8Path.html">Utf8Path</a></li><li><a href="struct.Utf8PathBuf.html">Utf8PathBuf</a></li><li><a href="struct.Utf8PrefixComponent.html">Utf8PrefixComponent</a></li></ul><h3 id="enums">Enums</h3><ul class="all-items"><li><a href="enum.Utf8Component.html">Utf8Component</a></li><li><a href="enum.Utf8Prefix.html">Utf8Prefix</a></li></ul><h3 id="functions">Functions</h3><ul class="all-items"><li><a href="fn.absolute_utf8.html">absolute_utf8</a></li></ul></section></div></main></body></html>

api/camino/enum.Utf8Component.html

Lines changed: 70 additions & 0 deletions
Large diffs are not rendered by default.

api/camino/enum.Utf8Prefix.html

Lines changed: 80 additions & 0 deletions
Large diffs are not rendered by default.

api/camino/fn.absolute_utf8.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!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="Makes the path absolute without accessing the filesystem, converting it to a `Utf8PathBuf`."><title>absolute_utf8 in camino - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="camino" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0-nightly (b19329a37 2024-11-21)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../camino/index.html">camino</a><span class="version">1.1.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">absolute_<wbr>utf8</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#errors" title="Errors">Errors</a></li><li><a href="#examples" title="Examples">Examples</a><ul><li><a href="#posix-paths" title="POSIX paths">POSIX paths</a></li><li><a href="#windows-paths" title="Windows paths">Windows paths</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate camino</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">camino</a></span><h1>Function <span class="fn">absolute_utf8</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/camino/lib.rs.html#3139-3148">Source</a> </span></div><pre class="rust item-decl"><code>pub fn absolute_utf8&lt;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt;(path: P) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="struct.Utf8PathBuf.html" title="struct camino::Utf8PathBuf">Utf8PathBuf</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Makes the path absolute without accessing the filesystem, converting it to a <a href="struct.Utf8PathBuf.html" title="struct camino::Utf8PathBuf"><code>Utf8PathBuf</code></a>.</p>
2+
<p>If the path is relative, the current directory is used as the base directory. All intermediate
3+
components will be resolved according to platform-specific rules, but unlike
4+
<a href="struct.Utf8Path.html#method.canonicalize" title="method camino::Utf8Path::canonicalize"><code>canonicalize</code></a> or <a href="struct.Utf8Path.html#method.canonicalize_utf8" title="method camino::Utf8Path::canonicalize_utf8"><code>canonicalize_utf8</code></a>,
5+
this does not resolve symlinks and may succeed even if the path does not exist.</p>
6+
<p><em>Requires Rust 1.79 or newer.</em></p>
7+
<h2 id="errors"><a class="doc-anchor" href="#errors">§</a>Errors</h2>
8+
<p>Errors if:</p>
9+
<ul>
10+
<li>The path is empty.</li>
11+
<li>The <a href="https://doc.rust-lang.org/nightly/std/env/fn.current_dir.html" title="fn std::env::current_dir">current directory</a> cannot be determined.</li>
12+
<li>The path is not valid UTF-8.</li>
13+
</ul>
14+
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2><h3 id="posix-paths"><a class="doc-anchor" href="#posix-paths">§</a>POSIX paths</h3>
15+
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>main() -&gt; std::io::Result&lt;()&gt; {
16+
<span class="kw">use </span>camino::Utf8Path;
17+
18+
<span class="comment">// Relative to absolute
19+
</span><span class="kw">let </span>absolute = camino::absolute_utf8(<span class="string">"foo/./bar"</span>)<span class="question-mark">?</span>;
20+
<span class="macro">assert!</span>(absolute.ends_with(<span class="string">"foo/bar"</span>));
21+
22+
<span class="comment">// Absolute to absolute
23+
</span><span class="kw">let </span>absolute = camino::absolute_utf8(<span class="string">"/foo//test/.././bar.rs"</span>)<span class="question-mark">?</span>;
24+
<span class="macro">assert_eq!</span>(absolute, Utf8Path::new(<span class="string">"/foo/test/../bar.rs"</span>));
25+
<span class="prelude-val">Ok</span>(())
26+
}</code></pre></div>
27+
<p>The path is resolved using <a href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13">POSIX semantics</a> except that it stops short of
28+
resolving symlinks. This means it will keep <code>..</code> components and trailing slashes.</p>
29+
<h3 id="windows-paths"><a class="doc-anchor" href="#windows-paths">§</a>Windows paths</h3>
30+
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>main() -&gt; std::io::Result&lt;()&gt; {
31+
<span class="kw">use </span>camino::Utf8Path;
32+
33+
<span class="comment">// Relative to absolute
34+
</span><span class="kw">let </span>absolute = camino::absolute_utf8(<span class="string">"foo/./bar"</span>)<span class="question-mark">?</span>;
35+
<span class="macro">assert!</span>(absolute.ends_with(<span class="string">r"foo\bar"</span>));
36+
37+
<span class="comment">// Absolute to absolute
38+
</span><span class="kw">let </span>absolute = camino::absolute_utf8(<span class="string">r"C:\foo//test\..\./bar.rs"</span>)<span class="question-mark">?</span>;
39+
40+
<span class="macro">assert_eq!</span>(absolute, Utf8Path::new(<span class="string">r"C:\foo\bar.rs"</span>));
41+
<span class="prelude-val">Ok</span>(())
42+
}</code></pre></div>
43+
<p>For verbatim paths this will simply return the path as given. For other paths this is currently
44+
equivalent to calling <a href="https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew"><code>GetFullPathNameW</code></a>.</p>
45+
<p>Note that this <a href="https://doc.rust-lang.org/nightly/std/io/index.html#platform-specific-behavior" title="mod std::io">may change in the future</a>.</p>
46+
</div></details></section></div></main></body></html>

0 commit comments

Comments
 (0)