Deploying to gh-pages from @ 26d40b9993
🚀
This commit is contained in:
parent
dfb146f52f
commit
ac5a4e78fd
13 changed files with 137 additions and 34 deletions
|
@ -3,5 +3,5 @@
|
|||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../actix_example/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate actix_example</p><div class="block version"><p>Version 0.1.0</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">List of all items</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>
|
||||
</span>
|
||||
</h1><h3 id="Functions">Functions</h3><ul class="functions docblock"><li><a href="fn.file_exists.html">file_exists</a></li><li><a href="fn.main.html">main</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_example"></div>
|
||||
</h1><h3 id="Functions">Functions</h3><ul class="functions docblock"><li><a href="fn.get_full_path_runner.html">get_full_path_runner</a></li><li><a href="fn.main.html">main</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_example"></div>
|
||||
<script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
@ -1,5 +0,0 @@
|
|||
<!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 `file_exists` fn in crate `actix_example`."><meta name="keywords" content="rust, rustlang, rust-lang, file_exists"><title>actix_example::file_exists - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../actix_example/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">actix_example</a></p><div id="sidebar-vars" data-name="file_exists" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">actix_example</a>::<wbr><a class="fn" href="">file_exists</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/actix_example/main.rs.html#16-24" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub(crate) fn file_exists(path: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, files: &<a class="struct" href="../cache_buster/map/struct.Files.html" title="struct cache_buster::map::Files">Files</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_example"></div>
|
||||
<script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
5
actix_example/fn.get_full_path_runner.html
Normal file
5
actix_example/fn.get_full_path_runner.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<!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 `get_full_path_runner` fn in crate `actix_example`."><meta name="keywords" content="rust, rustlang, rust-lang, get_full_path_runner"><title>actix_example::get_full_path_runner - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../actix_example/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">actix_example</a></p><div id="sidebar-vars" data-name="get_full_path_runner" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">actix_example</a>::<wbr><a class="fn" href="">get_full_path_runner</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/actix_example/main.rs.html#19-27" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub(crate) fn get_full_path_runner(path: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, files: &<a class="struct" href="../cache_buster/map/struct.Files.html" title="struct cache_buster::map::Files">Files</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_example"></div>
|
||||
<script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
@ -1,5 +1,5 @@
|
|||
<!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 `main` fn in crate `actix_example`."><meta name="keywords" content="rust, rustlang, rust-lang, main"><title>actix_example::main - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../actix_example/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">actix_example</a></p><div id="sidebar-vars" data-name="main" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">actix_example</a>::<wbr><a class="fn" href="">main</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/actix_example/main.rs.html#3-14" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub(crate) fn main()</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_example"></div>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">actix_example</a>::<wbr><a class="fn" href="">main</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/actix_example/main.rs.html#3-17" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub(crate) fn main()</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_example"></div>
|
||||
<script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
@ -1,6 +1,6 @@
|
|||
<!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 `actix_example` crate."><meta name="keywords" content="rust, rustlang, rust-lang, actix_example"><title>actix_example - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../actix_example/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate actix_example</p><div class="block version"><p>Version 0.1.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all actix_example's items</p></a><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class="location"></p><div id="sidebar-vars" data-name="actix_example" data-ty="mod" data-relpath="../"></div></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">actix_example</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/actix_example/main.rs.html#1-24" title="goto source code">[src]</a></span></h1><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.file_exists.html" title="actix_example::file_exists fn">file_exists</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.main.html" title="actix_example::main fn">main</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_example"></div>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">actix_example</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/actix_example/main.rs.html#1-27" title="goto source code">[src]</a></span></h1><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.get_full_path_runner.html" title="actix_example::get_full_path_runner fn">get_full_path_runner</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.main.html" title="actix_example::main fn">main</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="actix_example"></div>
|
||||
<script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
|
|
@ -1 +1 @@
|
|||
initSidebarItems({"fn":[["file_exists",""],["main",""]]});
|
||||
initSidebarItems({"fn":[["get_full_path_runner",""],["main",""]]});
|
|
@ -1,6 +1,6 @@
|
|||
<!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 `map` mod in crate `cache_buster`."><meta name="keywords" content="rust, rustlang, rust-lang, map"><title>cache_buster::map - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../cache_buster/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module map</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../index.html">cache_buster</a></p><div id="sidebar-vars" data-name="map" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">cache_buster</a>::<wbr><a class="mod" href="">map</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/cache_buster/map.rs.html#8-141" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">cache_buster</a>::<wbr><a class="mod" href="">map</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/cache_buster/map.rs.html#8-190" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.Files.html" title="cache_buster::map::Files struct">Files</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="cache_buster"></div>
|
||||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,3 @@
|
|||
(function() {var implementors = {};
|
||||
implementors["cache_buster"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"cache_buster/hash/struct.BusterBuilder.html\" title=\"struct cache_buster::hash::BusterBuilder\">BusterBuilder</a>","synthetic":false,"types":["cache_buster::hash::BusterBuilder"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"cache_buster/map/struct.Files.html\" title=\"struct cache_buster::map::Files\">Files</a>","synthetic":false,"types":["cache_buster::map::Files"]}];
|
||||
implementors["cache_buster"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"cache_buster/hash/struct.BusterBuilder.html\" title=\"struct cache_buster::hash::BusterBuilder\">BusterBuilder</a>","synthetic":false,"types":["cache_buster::hash::BusterBuilder"]}];
|
||||
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
|
@ -1,5 +1,5 @@
|
|||
var searchIndex = JSON.parse('{\
|
||||
"actix_example":{"doc":"","i":[[5,"main","actix_example","",null,[[]]],[5,"file_exists","","",null,[[["files",3],["str",15]],["bool",15]]]],"p":[]},\
|
||||
"cache_buster":{"doc":"","i":[[0,"hash","cache_buster","",null,null],[3,"Buster","cache_buster::hash","",null,null],[3,"BusterBuilder","","Builder for <code>Buster</code>.",null,null],[11,"source","","",0,[[["string",3],["into",8]]]],[11,"mime_types","","",0,[[["vec",3],["mime",3]]]],[11,"result","","",0,[[["string",3],["into",8]]]],[11,"copy","","",0,[[["bool",15]]]],[11,"follow_links","","",0,[[["bool",15]]]],[11,"build","","Builds a new <code>Buster</code>.",0,[[],[["buster",3],["result",4],["busterbuildererror",4]]]],[4,"BusterBuilderError","","Error type for BusterBuilder",null,null],[13,"UninitializedField","","Uninitialized field",1,null],[13,"ValidationError","","Custom validation error",1,null],[11,"init","","",2,[[],[["result",4],["error",3]]]],[11,"try_hash","","",2,[[],[["result",4],["files",3],["error",3]]]],[11,"hash","","",2,[[],[["result",4],["files",3],["error",3]]]],[0,"map","cache_buster","",null,null],[3,"Files","cache_buster::map","",null,null],[12,"map","","",3,null],[11,"new","","",3,[[["str",15]]]],[11,"get","","",3,[[["str",15]],[["option",4],["string",3]]]],[11,"add","","",3,[[["string",3]],[["result",4],["str",15]]]],[11,"to_env","","",3,[[]]],[11,"load","","",3,[[]]],[11,"from","cache_buster::hash","",2,[[]]],[11,"into","","",2,[[]]],[11,"to_owned","","",2,[[]]],[11,"clone_into","","",2,[[]]],[11,"borrow","","",2,[[]]],[11,"borrow_mut","","",2,[[]]],[11,"try_from","","",2,[[],["result",4]]],[11,"try_into","","",2,[[],["result",4]]],[11,"type_id","","",2,[[],["typeid",3]]],[11,"from","","",0,[[]]],[11,"into","","",0,[[]]],[11,"to_owned","","",0,[[]]],[11,"clone_into","","",0,[[]]],[11,"borrow","","",0,[[]]],[11,"borrow_mut","","",0,[[]]],[11,"try_from","","",0,[[],["result",4]]],[11,"try_into","","",0,[[],["result",4]]],[11,"type_id","","",0,[[],["typeid",3]]],[11,"from","","",1,[[]]],[11,"into","","",1,[[]]],[11,"to_string","","",1,[[],["string",3]]],[11,"borrow","","",1,[[]]],[11,"borrow_mut","","",1,[[]]],[11,"try_from","","",1,[[],["result",4]]],[11,"try_into","","",1,[[],["result",4]]],[11,"type_id","","",1,[[],["typeid",3]]],[11,"from","cache_buster::map","",3,[[]]],[11,"into","","",3,[[]]],[11,"to_owned","","",3,[[]]],[11,"clone_into","","",3,[[]]],[11,"borrow","","",3,[[]]],[11,"borrow_mut","","",3,[[]]],[11,"try_from","","",3,[[],["result",4]]],[11,"try_into","","",3,[[],["result",4]]],[11,"type_id","","",3,[[],["typeid",3]]],[11,"from","cache_buster::hash","",1,[[["uninitializedfielderror",3]]]],[11,"from","","",1,[[["string",3]]]],[11,"clone","","",2,[[],["buster",3]]],[11,"clone","","",0,[[],["busterbuilder",3]]],[11,"clone","cache_buster::map","",3,[[],["files",3]]],[11,"default","cache_buster::hash","",0,[[]]],[11,"default","cache_buster::map","",3,[[],["files",3]]],[11,"eq","","",3,[[["files",3]],["bool",15]]],[11,"ne","","",3,[[["files",3]],["bool",15]]],[11,"fmt","cache_buster::hash","",2,[[["formatter",3]],["result",6]]],[11,"fmt","","",1,[[["formatter",3]],["result",6]]],[11,"fmt","cache_buster::map","",3,[[["formatter",3]],["result",6]]],[11,"fmt","cache_buster::hash","",1,[[["formatter",3]],["result",6]]],[11,"serialize","cache_buster::map","",3,[[],["result",4]]],[11,"deserialize","","",3,[[],["result",4]]]],"p":[[3,"BusterBuilder"],[4,"BusterBuilderError"],[3,"Buster"],[3,"Files"]]}\
|
||||
"actix_example":{"doc":"","i":[[5,"main","actix_example","",null,[[]]],[5,"get_full_path_runner","","",null,[[["files",3],["str",15]],["bool",15]]]],"p":[]},\
|
||||
"cache_buster":{"doc":"","i":[[0,"hash","cache_buster","",null,null],[3,"Buster","cache_buster::hash","",null,null],[3,"BusterBuilder","","Builder for <code>Buster</code>.",null,null],[11,"source","","",0,[[["string",3],["into",8]]]],[11,"mime_types","","",0,[[["vec",3],["mime",3]]]],[11,"result","","",0,[[["string",3],["into",8]]]],[11,"copy","","",0,[[["bool",15]]]],[11,"follow_links","","",0,[[["bool",15]]]],[11,"build","","Builds a new <code>Buster</code>.",0,[[],[["result",4],["buster",3],["busterbuildererror",4]]]],[4,"BusterBuilderError","","Error type for BusterBuilder",null,null],[13,"UninitializedField","","Uninitialized field",1,null],[13,"ValidationError","","Custom validation error",1,null],[11,"init","","",2,[[],[["result",4],["error",3]]]],[11,"try_hash","","",2,[[],[["error",3],["result",4],["files",3]]]],[11,"hash","","",2,[[],[["error",3],["result",4],["files",3]]]],[0,"map","cache_buster","",null,null],[3,"Files","cache_buster::map","",null,null],[12,"map","","",3,null],[11,"new","","",3,[[["str",15]]]],[11,"get","","",3,[[["str",15]],[["str",15],["option",4]]]],[11,"get_full_path","","",3,[[["str",15]],[["option",4],["string",3]]]],[11,"add","","",3,[[["string",3]],[["result",4],["str",15]]]],[11,"to_env","","",3,[[]]],[11,"load","","",3,[[]]],[11,"from","cache_buster::hash","",2,[[]]],[11,"into","","",2,[[]]],[11,"to_owned","","",2,[[]]],[11,"clone_into","","",2,[[]]],[11,"borrow","","",2,[[]]],[11,"borrow_mut","","",2,[[]]],[11,"try_from","","",2,[[],["result",4]]],[11,"try_into","","",2,[[],["result",4]]],[11,"type_id","","",2,[[],["typeid",3]]],[11,"from","","",0,[[]]],[11,"into","","",0,[[]]],[11,"to_owned","","",0,[[]]],[11,"clone_into","","",0,[[]]],[11,"borrow","","",0,[[]]],[11,"borrow_mut","","",0,[[]]],[11,"try_from","","",0,[[],["result",4]]],[11,"try_into","","",0,[[],["result",4]]],[11,"type_id","","",0,[[],["typeid",3]]],[11,"from","","",1,[[]]],[11,"into","","",1,[[]]],[11,"to_string","","",1,[[],["string",3]]],[11,"borrow","","",1,[[]]],[11,"borrow_mut","","",1,[[]]],[11,"try_from","","",1,[[],["result",4]]],[11,"try_into","","",1,[[],["result",4]]],[11,"type_id","","",1,[[],["typeid",3]]],[11,"from","cache_buster::map","",3,[[]]],[11,"into","","",3,[[]]],[11,"to_owned","","",3,[[]]],[11,"clone_into","","",3,[[]]],[11,"borrow","","",3,[[]]],[11,"borrow_mut","","",3,[[]]],[11,"try_from","","",3,[[],["result",4]]],[11,"try_into","","",3,[[],["result",4]]],[11,"type_id","","",3,[[],["typeid",3]]],[11,"from","cache_buster::hash","",1,[[["uninitializedfielderror",3]]]],[11,"from","","",1,[[["string",3]]]],[11,"clone","","",2,[[],["buster",3]]],[11,"clone","","",0,[[],["busterbuilder",3]]],[11,"clone","cache_buster::map","",3,[[],["files",3]]],[11,"default","cache_buster::hash","",0,[[]]],[11,"eq","cache_buster::map","",3,[[["files",3]],["bool",15]]],[11,"ne","","",3,[[["files",3]],["bool",15]]],[11,"fmt","cache_buster::hash","",2,[[["formatter",3]],["result",6]]],[11,"fmt","","",1,[[["formatter",3]],["result",6]]],[11,"fmt","cache_buster::map","",3,[[["formatter",3]],["result",6]]],[11,"fmt","cache_buster::hash","",1,[[["formatter",3]],["result",6]]],[11,"serialize","cache_buster::map","",3,[[],["result",4]]],[11,"deserialize","","",3,[[],["result",4]]]],"p":[[3,"BusterBuilder"],[4,"BusterBuilderError"],[3,"Buster"],[3,"Files"]]}\
|
||||
}');
|
||||
addSearchOptions(searchIndex);initSearch(searchIndex);
|
|
@ -25,26 +25,32 @@
|
|||
<span id="22">22</span>
|
||||
<span id="23">23</span>
|
||||
<span id="24">24</span>
|
||||
<span id="25">25</span>
|
||||
<span id="26">26</span>
|
||||
<span id="27">27</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">cache_buster</span>::<span class="ident">Files</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">files</span> <span class="op">=</span> <span class="ident">Files</span>::<span class="ident">load</span>();
|
||||
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">file_exists</span>(<span class="string">"../dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">file_exists</span>(
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">get_full_path_runner</span>(<span class="string">"../dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">get_full_path_runner</span>(
|
||||
<span class="string">"../dist/a/b/c/d/s/d/svg/credit-card.svg"</span>,
|
||||
<span class="kw-2">&</span><span class="ident">files</span>
|
||||
));
|
||||
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">file_exists</span>(<span class="string">"dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">file_exists</span>(<span class="string">"dist/a/b/c/d/s/d/svg/credit-card.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">get_full_path_runner</span>(<span class="string">"dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">get_full_path_runner</span>(
|
||||
<span class="string">"dist/a/b/c/d/s/d/svg/credit-card.svg"</span>,
|
||||
<span class="kw-2">&</span><span class="ident">files</span>
|
||||
));
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">file_exists</span>(<span class="ident">path</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">files</span>: <span class="kw-2">&</span><span class="ident">Files</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
|
||||
<span class="kw">fn</span> <span class="ident">get_full_path_runner</span>(<span class="ident">path</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">files</span>: <span class="kw-2">&</span><span class="ident">Files</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
|
||||
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">file</span>) <span class="op">=</span> <span class="ident">files</span>.<span class="ident">get</span>(<span class="ident">path</span>) {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">file</span>) <span class="op">=</span> <span class="ident">files</span>.<span class="ident">get_full_path</span>(<span class="ident">path</span>) {
|
||||
<span class="ident">Path</span>::<span class="ident">new</span>(<span class="ident">file</span>).<span class="ident">exists</span>()
|
||||
} <span class="kw">else</span> {
|
||||
<span class="bool-val">false</span>
|
||||
|
|
|
@ -307,7 +307,7 @@
|
|||
<span class="comment">//</span>
|
||||
<span class="comment">// doesn't process files for which mime is not resolved</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">try_hash</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Files</span>, <span class="ident">Error</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_map</span>: <span class="ident">Files</span> <span class="op">=</span> <span class="ident">Files</span>::<span class="ident">default</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_map</span>: <span class="ident">Files</span> <span class="op">=</span> <span class="ident">Files</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">result</span>);
|
||||
<span class="kw">for</span> <span class="ident">entry</span> <span class="kw">in</span> <span class="ident">WalkDir</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">source</span>)
|
||||
.<span class="ident">follow_links</span>(<span class="self">self</span>.<span class="ident">follow_links</span>)
|
||||
.<span class="ident">into_iter</span>()
|
||||
|
@ -345,7 +345,7 @@
|
|||
<span class="comment">// panics when mimetypes are detected. This way you'll know which files are ignored</span>
|
||||
<span class="comment">// from processing</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">hash</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Files</span>, <span class="ident">Error</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_map</span>: <span class="ident">Files</span> <span class="op">=</span> <span class="ident">Files</span>::<span class="ident">default</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_map</span>: <span class="ident">Files</span> <span class="op">=</span> <span class="ident">Files</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">result</span>);
|
||||
|
||||
<span class="kw">for</span> <span class="ident">entry</span> <span class="kw">in</span> <span class="ident">WalkDir</span>::<span class="ident">new</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">source</span>)
|
||||
.<span class="ident">follow_links</span>(<span class="self">self</span>.<span class="ident">follow_links</span>)
|
||||
|
|
|
@ -142,6 +142,55 @@
|
|||
<span id="139">139</span>
|
||||
<span id="140">140</span>
|
||||
<span id="141">141</span>
|
||||
<span id="142">142</span>
|
||||
<span id="143">143</span>
|
||||
<span id="144">144</span>
|
||||
<span id="145">145</span>
|
||||
<span id="146">146</span>
|
||||
<span id="147">147</span>
|
||||
<span id="148">148</span>
|
||||
<span id="149">149</span>
|
||||
<span id="150">150</span>
|
||||
<span id="151">151</span>
|
||||
<span id="152">152</span>
|
||||
<span id="153">153</span>
|
||||
<span id="154">154</span>
|
||||
<span id="155">155</span>
|
||||
<span id="156">156</span>
|
||||
<span id="157">157</span>
|
||||
<span id="158">158</span>
|
||||
<span id="159">159</span>
|
||||
<span id="160">160</span>
|
||||
<span id="161">161</span>
|
||||
<span id="162">162</span>
|
||||
<span id="163">163</span>
|
||||
<span id="164">164</span>
|
||||
<span id="165">165</span>
|
||||
<span id="166">166</span>
|
||||
<span id="167">167</span>
|
||||
<span id="168">168</span>
|
||||
<span id="169">169</span>
|
||||
<span id="170">170</span>
|
||||
<span id="171">171</span>
|
||||
<span id="172">172</span>
|
||||
<span id="173">173</span>
|
||||
<span id="174">174</span>
|
||||
<span id="175">175</span>
|
||||
<span id="176">176</span>
|
||||
<span id="177">177</span>
|
||||
<span id="178">178</span>
|
||||
<span id="179">179</span>
|
||||
<span id="180">180</span>
|
||||
<span id="181">181</span>
|
||||
<span id="182">182</span>
|
||||
<span id="183">183</span>
|
||||
<span id="184">184</span>
|
||||
<span id="185">185</span>
|
||||
<span id="186">186</span>
|
||||
<span id="187">187</span>
|
||||
<span id="188">188</span>
|
||||
<span id="189">189</span>
|
||||
<span id="190">190</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="comment">/*
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
|
@ -157,7 +206,7 @@
|
|||
|
||||
<span class="kw">const</span> <span class="ident">ENV_VAR_NAME</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"CACHE_BUSTER_FILE_MAP"</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Default</span>, <span class="ident">Clone</span>, <span class="ident">Serialize</span>, <span class="ident">Deserialize</span>)]</span>
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Clone</span>, <span class="ident">Serialize</span>, <span class="ident">Deserialize</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Files</span> {
|
||||
<span class="kw">pub</span> <span class="ident">map</span>: <span class="ident">HashMap</span><span class="op"><</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">></span>,
|
||||
<span class="ident">base_dir</span>: <span class="ident">String</span>,
|
||||
|
@ -171,7 +220,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span>(<span class="kw-2">&</span><span class="lifetime">'a</span> <span class="self">self</span>, <span class="ident">path</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">String</span><span class="op">></span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span>(<span class="kw-2">&</span><span class="lifetime">'a</span> <span class="self">self</span>, <span class="ident">path</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span><span class="op">></span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">path</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="ident">path</span>) {
|
||||
<span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="ident">path</span>[<span class="self">self</span>.<span class="ident">base_dir</span>.<span class="ident">len</span>()..])
|
||||
} <span class="kw">else</span> {
|
||||
<span class="prelude-val">None</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_full_path</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span>(<span class="kw-2">&</span><span class="lifetime">'a</span> <span class="self">self</span>, <span class="ident">path</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">String</span><span class="op">></span> {
|
||||
<span class="self">self</span>.<span class="ident">map</span>.<span class="ident">get</span>(<span class="ident">path</span>)
|
||||
}
|
||||
|
||||
|
@ -215,7 +272,7 @@
|
|||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">path</span>::<span class="ident">Path</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
||||
<span class="kw">fn</span> <span class="ident">get_works</span>() {
|
||||
<span class="kw">fn</span> <span class="ident">get_full_path_works</span>() {
|
||||
<span class="kw">let</span> <span class="ident">types</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">mime</span>::<span class="ident">IMAGE_PNG</span>,
|
||||
<span class="ident">mime</span>::<span class="ident">IMAGE_SVG</span>,
|
||||
|
@ -235,19 +292,22 @@
|
|||
<span class="ident">config</span>.<span class="ident">init</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">files</span> <span class="op">=</span> <span class="ident">config</span>.<span class="ident">hash</span>().<span class="ident">unwrap</span>();
|
||||
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">file_exists</span>(<span class="string">"./dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">file_exists</span>(
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">get_full_path_runner</span>(<span class="string">"./dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">get_full_path_runner</span>(
|
||||
<span class="string">"./dist/a/b/c/d/s/d/svg/credit-card.svg"</span>,
|
||||
<span class="kw-2">&</span><span class="ident">files</span>
|
||||
));
|
||||
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">file_exists</span>(<span class="string">"dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">file_exists</span>(<span class="string">"dist/a/b/c/d/s/d/svg/credit-card.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">get_full_path_runner</span>(<span class="string">"dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">get_full_path_runner</span>(
|
||||
<span class="string">"dist/a/b/c/d/s/d/svg/credit-card.svg"</span>,
|
||||
<span class="kw-2">&</span><span class="ident">files</span>
|
||||
));
|
||||
<span class="ident">cleanup</span>(<span class="kw-2">&</span><span class="ident">config</span>);
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">file_exists</span>(<span class="ident">path</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">files</span>: <span class="kw-2">&</span><span class="ident">Files</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">file</span>) <span class="op">=</span> <span class="ident">files</span>.<span class="ident">get</span>(<span class="ident">path</span>) {
|
||||
<span class="kw">fn</span> <span class="ident">get_full_path_runner</span>(<span class="ident">path</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">files</span>: <span class="kw-2">&</span><span class="ident">Files</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">file</span>) <span class="op">=</span> <span class="ident">files</span>.<span class="ident">get_full_path</span>(<span class="ident">path</span>) {
|
||||
<span class="ident">Path</span>::<span class="ident">new</span>(<span class="ident">file</span>).<span class="ident">exists</span>()
|
||||
} <span class="kw">else</span> {
|
||||
<span class="bool-val">false</span>
|
||||
|
@ -283,6 +343,44 @@
|
|||
|
||||
<span class="ident">cleanup</span>(<span class="kw-2">&</span><span class="ident">config</span>);
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
||||
<span class="kw">fn</span> <span class="ident">get_works</span>() {
|
||||
<span class="kw">let</span> <span class="ident">types</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">mime</span>::<span class="ident">IMAGE_PNG</span>,
|
||||
<span class="ident">mime</span>::<span class="ident">IMAGE_SVG</span>,
|
||||
<span class="ident">mime</span>::<span class="ident">IMAGE_JPEG</span>,
|
||||
<span class="ident">mime</span>::<span class="ident">IMAGE_GIF</span>,
|
||||
];
|
||||
|
||||
<span class="kw">let</span> <span class="ident">config</span> <span class="op">=</span> <span class="ident">BusterBuilder</span>::<span class="ident">default</span>()
|
||||
.<span class="ident">source</span>(<span class="string">"./dist"</span>)
|
||||
.<span class="ident">result</span>(<span class="string">"/tmp/prod5"</span>)
|
||||
.<span class="ident">mime_types</span>(<span class="ident">types</span>)
|
||||
.<span class="ident">copy</span>(<span class="bool-val">true</span>)
|
||||
.<span class="ident">follow_links</span>(<span class="bool-val">true</span>)
|
||||
.<span class="ident">build</span>()
|
||||
.<span class="ident">unwrap</span>();
|
||||
|
||||
<span class="ident">config</span>.<span class="ident">init</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">files</span> <span class="op">=</span> <span class="ident">config</span>.<span class="ident">hash</span>().<span class="ident">unwrap</span>();
|
||||
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">get_runner</span>(<span class="string">"./dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">get_runner</span>(<span class="string">"./dist/a/b/c/d/s/d/svg/credit-card.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">get_runner</span>(<span class="string">"dist/log-out.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">get_runner</span>(<span class="string">"dist/a/b/c/d/s/d/svg/credit-card.svg"</span>, <span class="kw-2">&</span><span class="ident">files</span>));
|
||||
<span class="ident">cleanup</span>(<span class="kw-2">&</span><span class="ident">config</span>);
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">get_runner</span>(<span class="ident">path</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">files</span>: <span class="kw-2">&</span><span class="ident">Files</span>) <span class="op">-</span><span class="op">></span> <span class="ident">bool</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">file</span>) <span class="op">=</span> <span class="ident">files</span>.<span class="ident">get</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="kw-2">&</span><span class="ident">files</span>.<span class="ident">base_dir</span>).<span class="ident">join</span>(<span class="kw-2">&</span><span class="ident">file</span>[<span class="number">1</span>..]);
|
||||
<span class="ident">path</span>.<span class="ident">exists</span>()
|
||||
} <span class="kw">else</span> {
|
||||
<span class="bool-val">false</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
</pre></div>
|
||||
</section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="cache_buster"></div>
|
||||
|
|
Loading…
Reference in a new issue