Deploying to gh-pages from @ 3cd38511fa 🚀

This commit is contained in:
realaravinth
2024-02-19 14:58:12 +00:00
parent 120b15c0c7
commit 500a7b89d5
757 changed files with 20470 additions and 19361 deletions

View File

@@ -1,4 +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="Source of the Rust file `src/pages/auth/login.rs`."><title>login.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/auth/login.rs`."><title>login.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -44,9 +45,9 @@
<span class="kw">use </span><span class="kw">crate</span>::PAGES;
<span class="attr">#[derive(Clone, TemplateOnce)]
#[template(path = <span class="string">&quot;auth/login/index.html&quot;</span>)]
#[template(path = <span class="string">"auth/login/index.html"</span>)]
</span><span class="kw">struct </span>IndexPage;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Login&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Login"</span>;
<span class="kw">impl </span>Default <span class="kw">for </span>IndexPage {
<span class="kw">fn </span>default() -&gt; <span class="self">Self </span>{
@@ -58,10 +59,10 @@
<span class="kw">static </span><span class="kw-2">ref </span>INDEX: String = IndexPage.render_once().unwrap();
}
<span class="attr">#[get(path = <span class="string">&quot;PAGES.auth.login&quot;</span>)]
<span class="attr">#[get(path = <span class="string">"PAGES.auth.login"</span>)]
</span><span class="kw">pub async fn </span>login() -&gt; <span class="kw">impl </span>Responder {
HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(<span class="kw-2">&amp;**</span>INDEX)
}
</code></pre></div></section></main></body></html>

View File

@@ -1,4 +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="Source of the Rust file `src/pages/auth/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/auth/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -65,18 +66,18 @@
<span class="kw">use </span>actix_auth_middleware::GetLoginRoute;
<span class="kw">pub struct </span>Auth {
<span class="kw">pub </span>login: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>join: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>login: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>join: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Auth {
<span class="kw">pub const fn </span>new() -&gt; Auth {
Auth {
login: <span class="string">&quot;/login&quot;</span>,
join: <span class="string">&quot;/join&quot;</span>,
login: <span class="string">"/login"</span>,
join: <span class="string">"/join"</span>,
}
}
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str; <span class="number">2</span>] {
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">'static </span>str; <span class="number">2</span>] {
<span class="kw">const </span>AUTH: Auth = Auth::new();
[AUTH.login, AUTH.join]
}
@@ -86,7 +87,7 @@
<span class="kw">fn </span>get_login_route(<span class="kw-2">&amp;</span><span class="self">self</span>, src: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>str&gt;) -&gt; String {
<span class="kw">if let </span><span class="prelude-val">Some</span>(redirect_to) = src {
<span class="macro">format!</span>(
<span class="string">&quot;{}?redirect_to={}&quot;</span>,
<span class="string">"{}?redirect_to={}"</span>,
<span class="self">self</span>.login,
urlencoding::encode(redirect_to)
)

View File

@@ -1,4 +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="Source of the Rust file `src/pages/auth/register.rs`."><title>register.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/auth/register.rs`."><title>register.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -39,10 +40,10 @@
<span class="kw">use </span>sailfish::TemplateOnce;
<span class="attr">#[derive(Clone, TemplateOnce)]
#[template(path = <span class="string">&quot;auth/register/index.html&quot;</span>)]
#[template(path = <span class="string">"auth/register/index.html"</span>)]
</span><span class="kw">struct </span>IndexPage;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Join&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Join"</span>;
<span class="kw">impl </span>Default <span class="kw">for </span>IndexPage {
<span class="kw">fn </span>default() -&gt; <span class="self">Self </span>{
@@ -54,10 +55,10 @@
<span class="kw">static </span><span class="kw-2">ref </span>INDEX: String = IndexPage.render_once().unwrap();
}
<span class="attr">#[my_codegen::get(path = <span class="string">&quot;crate::PAGES.auth.join&quot;</span>)]
<span class="attr">#[my_codegen::get(path = <span class="string">"crate::PAGES.auth.join"</span>)]
</span><span class="kw">pub async fn </span>join() -&gt; <span class="kw">impl </span>Responder {
HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(<span class="kw-2">&amp;**</span>INDEX)
}
</code></pre></div></section></main></body></html>

View File

@@ -1,4 +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="Source of the Rust file `src/pages/auth/sudo.rs`."><title>sudo.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/auth/sudo.rs`."><title>sudo.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -42,25 +43,25 @@
<span class="kw">use </span>sailfish::TemplateOnce;
<span class="attr">#[derive(Clone, TemplateOnce)]
#[template(path = <span class="string">&quot;auth/sudo/index.html&quot;</span>)]
</span><span class="kw">pub struct </span>SudoPage&lt;<span class="lifetime">&#39;a</span>, K, V&gt;
#[template(path = <span class="string">"auth/sudo/index.html"</span>)]
</span><span class="kw">pub struct </span>SudoPage&lt;<span class="lifetime">'a</span>, K, V&gt;
<span class="kw">where
</span>K: Display + Render,
V: Display + Render,
{
url: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
url: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
data: <span class="prelude-ty">Option</span>&lt;Vec&lt;(K, V)&gt;&gt;,
}
<span class="kw">pub const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Confirm Access&quot;</span>;
<span class="kw">pub const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Confirm Access"</span>;
<span class="kw">impl</span>&lt;<span class="lifetime">&#39;a</span>, K, V&gt; SudoPage&lt;<span class="lifetime">&#39;a</span>, K, V&gt;
<span class="kw">impl</span>&lt;<span class="lifetime">'a</span>, K, V&gt; SudoPage&lt;<span class="lifetime">'a</span>, K, V&gt;
<span class="kw">where
</span>K: Display + Render,
V: Display + Render,
{
<span class="comment">//pub fn new(url: &amp;&#39;a str, data: Option&lt;Vec&lt;(&amp;&#39;a str, &amp;&#39;a str)&gt;&gt;) -&gt; Self {
</span><span class="kw">pub fn </span>new(url: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str, data: <span class="prelude-ty">Option</span>&lt;Vec&lt;(K, V)&gt;&gt;) -&gt; <span class="self">Self </span>{
<span class="comment">//pub fn new(url: &amp;'a str, data: Option&lt;Vec&lt;(&amp;'a str, &amp;'a str)&gt;&gt;) -&gt; Self {
</span><span class="kw">pub fn </span>new(url: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str, data: <span class="prelude-ty">Option</span>&lt;Vec&lt;(K, V)&gt;&gt;) -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{ url, data }
}
}

View File

@@ -1,4 +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="Source of the Rust file `src/pages/errors.rs`."><title>errors.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/errors.rs`."><title>errors.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -118,46 +119,46 @@
<span class="kw">use </span><span class="kw">crate</span>::errors::PageError;
<span class="attr">#[derive(Clone, TemplateOnce)]
#[template(path = <span class="string">&quot;errors/index.html&quot;</span>)]
</span><span class="kw">struct </span>ErrorPage&lt;<span class="lifetime">&#39;a</span>&gt; {
title: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
message: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
#[template(path = <span class="string">"errors/index.html"</span>)]
</span><span class="kw">struct </span>ErrorPage&lt;<span class="lifetime">'a</span>&gt; {
title: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
message: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
}
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Error&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Error"</span>;
<span class="kw">impl</span>&lt;<span class="lifetime">&#39;a</span>&gt; ErrorPage&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">fn </span>new(title: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str, message: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str) -&gt; <span class="self">Self </span>{
<span class="kw">impl</span>&lt;<span class="lifetime">'a</span>&gt; ErrorPage&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">fn </span>new(title: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str, message: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str) -&gt; <span class="self">Self </span>{
ErrorPage { title, message }
}
}
<span class="macro">lazy_static! </span>{
<span class="kw">static </span><span class="kw-2">ref </span>INTERNAL_SERVER_ERROR_BODY: String = ErrorPage::new(
<span class="string">&quot;Internal Server Error&quot;</span>,
<span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">&quot;{}&quot;</span>, PageError::InternalServerError),
<span class="string">"Internal Server Error"</span>,
<span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"{}"</span>, PageError::InternalServerError),
)
.render_once()
.unwrap();
<span class="kw">static </span><span class="kw-2">ref </span>UNKNOWN_ERROR_BODY: String = ErrorPage::new(
<span class="string">&quot;Something went wrong&quot;</span>,
<span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">&quot;{}&quot;</span>, PageError::InternalServerError),
<span class="string">"Something went wrong"</span>,
<span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"{}"</span>, PageError::InternalServerError),
)
.render_once()
.unwrap();
}
<span class="kw">const </span>ERROR_ROUTE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;/error/{id}&quot;</span>;
<span class="kw">const </span>ERROR_ROUTE: <span class="kw-2">&amp;</span>str = <span class="string">"/error/{id}"</span>;
<span class="attr">#[my_codegen::get(path = <span class="string">&quot;ERROR_ROUTE&quot;</span>)]
<span class="attr">#[my_codegen::get(path = <span class="string">"ERROR_ROUTE"</span>)]
</span><span class="kw">async fn </span>error(path: web::Path&lt;usize&gt;) -&gt; <span class="kw">impl </span>Responder {
<span class="kw">let </span>resp = <span class="kw">match </span>path.into_inner() {
<span class="number">500 </span>=&gt; HttpResponse::InternalServerError()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(<span class="kw-2">&amp;**</span>INTERNAL_SERVER_ERROR_BODY),
<span class="kw">_ </span>=&gt; HttpResponse::InternalServerError()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(<span class="kw-2">&amp;**</span>UNKNOWN_ERROR_BODY),
};
@@ -170,15 +171,15 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Errors {
<span class="kw">pub </span>internal_server_error: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>unknown_error: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>internal_server_error: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>unknown_error: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Errors {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
Errors {
internal_server_error: <span class="string">&quot;/error/500&quot;</span>,
unknown_error: <span class="string">&quot;/error/007&quot;</span>,
internal_server_error: <span class="string">"/error/500"</span>,
unknown_error: <span class="string">"/error/007"</span>,
}
}
}

View File

@@ -1,4 +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="Source of the Rust file `src/pages/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -125,7 +126,7 @@
<span class="kw">pub mod </span>routes;
<span class="kw">mod </span>sitemap;
<span class="kw">pub const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;mCaptcha&quot;</span>;
<span class="kw">pub const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"mCaptcha"</span>;
<span class="kw">pub fn </span>services(cfg: <span class="kw-2">&amp;mut </span>ServiceConfig) {
auth::services(cfg);
@@ -161,9 +162,9 @@
}
<span class="kw">async fn </span>protected_pages_templates_work(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;templateuser&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;longpassword&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;templateuser@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"templateuser"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassword"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"templateuser@a.com"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
delete_user(data, NAME).<span class="kw">await</span>;

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -111,7 +112,7 @@
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/index.html&quot;</span>)]
#[template(path = <span class="string">"panel/index.html"</span>)]
</span><span class="kw">pub struct </span>IndexPage {
sitekeys: Vec&lt;Captcha&gt;,
}
@@ -122,18 +123,18 @@
}
}
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Dashboard&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Dashboard"</span>;
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.home&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.home"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>panel(data: AppData, id: Identity) -&gt; PageResult&lt;<span class="kw">impl </span>Responder&gt; {
<span class="kw">let </span>username = id.identity().unwrap();
<span class="kw">let </span>sitekeys = data.db.get_all_user_captchas(<span class="kw-2">&amp;</span>username).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>body = IndexPage::new(sitekeys).render_once().unwrap();
<span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(body))
}
@@ -151,9 +152,9 @@
<span class="kw">use </span><span class="kw">super</span>::utils::routes::Utils;
<span class="kw">pub struct </span>Panel {
<span class="kw">pub </span>home: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>home: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>sitekey: Sitekey,
<span class="kw">pub </span>notifications: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>notifications: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>settings: Settings,
<span class="kw">pub </span>utils: Utils,
}
@@ -161,15 +162,15 @@
<span class="kw">impl </span>Panel {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
Panel {
home: <span class="string">&quot;/&quot;</span>,
home: <span class="string">"/"</span>,
sitekey: Sitekey::new(),
notifications: <span class="string">&quot;/notifications&quot;</span>,
notifications: <span class="string">"/notifications"</span>,
settings: Settings::new(),
utils: Utils::new(),
}
}
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str; <span class="number">6</span>] {
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">'static </span>str; <span class="number">6</span>] {
<span class="kw">const </span>PANEL: Panel = Panel::new();
<span class="kw">const </span>S: [<span class="kw-2">&amp;</span>str; <span class="number">2</span>] = Sitekey::get_sitemap();

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/notifications.rs`."><title>notifications.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/notifications.rs`."><title>notifications.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -138,7 +139,7 @@
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="attr">#[derive(TemplateOnce)]
#[template(path = <span class="string">&quot;panel/notifications/index.html&quot;</span>)]
#[template(path = <span class="string">"panel/notifications/index.html"</span>)]
</span><span class="kw">pub struct </span>IndexPage {
<span class="doccomment">/// notifications
</span>n: Vec&lt;Notification&gt;,
@@ -176,15 +177,15 @@
}
}
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Notifications&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Notifications"</span>;
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.notifications&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.notifications"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>notifications(data: AppData, id: Identity) -&gt; PageResult&lt;<span class="kw">impl </span>Responder&gt; {
<span class="kw">let </span>receiver = id.identity().unwrap();
<span class="comment">// TODO handle error where payload.to doesn&#39;t exist
<span class="comment">// TODO handle error where payload.to doesn't exist
// let mut notifications = runner::get_notification(&amp;data, &amp;receiver).await?;
</span><span class="kw">let </span><span class="kw-2">mut </span>notifications = data.db.get_all_unread_notifications(<span class="kw-2">&amp;</span>receiver).<span class="kw">await</span><span class="question-mark">?</span>;
@@ -192,7 +193,7 @@
<span class="kw">let </span>body = IndexPage::new(notifications).render_once().unwrap();
<span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(body))
}
@@ -212,35 +213,35 @@
};
<span class="kw">let </span>timestamp = n.received.unix_timestamp();
<span class="macro">println!</span>(<span class="string">&quot;timestamp: {}&quot;</span>, timestamp);
<span class="macro">println!</span>(<span class="string">"timestamp: {}"</span>, timestamp);
<span class="comment">// seconds test
</span><span class="macro">assert!</span>(n.print_date().contains(<span class="string">&quot;seconds ago&quot;</span>));
</span><span class="macro">assert!</span>(n.print_date().contains(<span class="string">"seconds ago"</span>));
n.received = OffsetDateTime::from_unix_timestamp(timestamp - <span class="number">5</span>).unwrap();
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">&quot;seconds ago&quot;</span>));
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">"seconds ago"</span>));
<span class="comment">// minutes test
</span>n.received =
OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * <span class="number">2</span>).unwrap();
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">&quot;minutes ago&quot;</span>));
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">"minutes ago"</span>));
n.received =
OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * <span class="number">56</span>).unwrap();
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">&quot;minutes ago&quot;</span>));
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">"minutes ago"</span>));
<span class="comment">// hours test
</span>n.received = OffsetDateTime::from_unix_timestamp(timestamp - HOUR).unwrap();
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">&quot;hours ago&quot;</span>));
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">"hours ago"</span>));
n.received = OffsetDateTime::from_unix_timestamp(timestamp - HOUR * <span class="number">23</span>).unwrap();
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">&quot;hours ago&quot;</span>));
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">"hours ago"</span>));
<span class="comment">// days test
</span>n.received = OffsetDateTime::from_unix_timestamp(timestamp - <span class="number">2 </span>* WEEK).unwrap();
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">&quot;days ago&quot;</span>));
<span class="macro">assert!</span>(n.print_date().contains(<span class="string">"days ago"</span>));
<span class="comment">// date test
</span>n.received = OffsetDateTime::from_unix_timestamp(timestamp - <span class="number">6 </span>* WEEK).unwrap();
<span class="kw">let </span>date = <span class="macro">format!</span>(
<span class="string">&quot;{}{}{}&quot;</span>,
<span class="string">"{}{}{}"</span>,
n.received.year(),
n.received.month(),
n.received.date()

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/settings.rs`."><title>settings.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/settings.rs`."><title>settings.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -114,21 +115,21 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Settings {
<span class="kw">pub </span>home: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>delete_account: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>update_secret: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>home: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>delete_account: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>update_secret: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Settings {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
Settings {
home: <span class="string">&quot;/settings&quot;</span>,
delete_account: <span class="string">&quot;/settings/account/delete&quot;</span>,
update_secret: <span class="string">&quot;/settings/secret/update&quot;</span>,
home: <span class="string">"/settings"</span>,
delete_account: <span class="string">"/settings/account/delete"</span>,
update_secret: <span class="string">"/settings/secret/update"</span>,
}
}
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str; <span class="number">1</span>] {
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">'static </span>str; <span class="number">1</span>] {
<span class="kw">const </span>S: Settings = Settings::new();
[S.home]
@@ -142,19 +143,19 @@
cfg.service(delete_account);
}
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Settings&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Settings"</span>;
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/settings/index.html&quot;</span>)]
</span><span class="kw">pub struct </span>IndexPage&lt;<span class="lifetime">&#39;a</span>&gt; {
#[template(path = <span class="string">"panel/settings/index.html"</span>)]
</span><span class="kw">pub struct </span>IndexPage&lt;<span class="lifetime">'a</span>&gt; {
email: <span class="prelude-ty">Option</span>&lt;String&gt;,
secret: String,
username: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
username: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
}
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.settings.home&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.settings.home"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>settings(data: AppData, id: Identity) -&gt; PageResult&lt;<span class="kw">impl </span>Responder&gt; {
<span class="kw">let </span>username = id.identity().unwrap();
@@ -171,33 +172,33 @@
<span class="kw">let </span>body = data.render_once().unwrap();
<span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(body))
}
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.settings.delete_account&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.settings.delete_account"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>delete_account() -&gt; <span class="kw">impl </span>Responder {
<span class="kw">let </span>page = SudoPage::&lt;u8, u8&gt;::new(<span class="kw">crate</span>::V1_API_ROUTES.account.delete, <span class="prelude-val">None</span>)
.render_once()
.unwrap();
HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(page)
}
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.settings.update_secret&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.settings.update_secret"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>update_secret() -&gt; <span class="kw">impl </span>Responder {
<span class="kw">let </span>page = SudoPage::&lt;u8, u8&gt;::new(<span class="kw">crate</span>::V1_API_ROUTES.account.update_secret, <span class="prelude-val">None</span>)
.render_once()
.unwrap();
HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(page)
}
</code></pre></div></section></main></body></html>

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/sitekey/add.rs`."><title>add.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/sitekey/add.rs`."><title>add.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -85,7 +86,7 @@
<span class="kw">use </span>lazy_static::lazy_static;
<span class="kw">use </span>sailfish::TemplateOnce;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Add Sitekey&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Add Sitekey"</span>;
<span class="macro">lazy_static! </span>{
<span class="kw">static </span><span class="kw-2">ref </span>ADVANCE_INDEX: String =
@@ -94,19 +95,19 @@
}
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/sitekey/add/advance/index.html&quot;</span>)]
</span><span class="kw">pub struct </span>AdvanceIndexPage&lt;<span class="lifetime">&#39;a</span>&gt; {
#[template(path = <span class="string">"panel/sitekey/add/advance/index.html"</span>)]
</span><span class="kw">pub struct </span>AdvanceIndexPage&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">pub </span>levels: usize,
<span class="kw">pub </span>form_title: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
<span class="kw">pub </span>form_description: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
<span class="kw">pub </span>form_title: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
<span class="kw">pub </span>form_description: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
<span class="kw">pub </span>form_duration: usize,
}
<span class="kw">impl</span>&lt;<span class="lifetime">&#39;a</span>&gt; Default <span class="kw">for </span>AdvanceIndexPage&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">impl</span>&lt;<span class="lifetime">'a</span>&gt; Default <span class="kw">for </span>AdvanceIndexPage&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">fn </span>default() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
levels: <span class="number">1</span>,
form_description: <span class="string">&quot;&quot;</span>,
form_description: <span class="string">""</span>,
form_title: PAGE,
form_duration: <span class="number">30</span>,
}
@@ -114,29 +115,29 @@
}
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.sitekey.add_advance&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.sitekey.add_advance"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>advance() -&gt; <span class="kw">impl </span>Responder {
HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(<span class="kw-2">&amp;**</span>ADVANCE_INDEX)
}
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/sitekey/add/novice/index.html&quot;</span>)]
</span><span class="kw">pub struct </span>EasyIndexPage&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">pub </span>form_description: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
<span class="kw">pub </span>form_title: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
#[template(path = <span class="string">"panel/sitekey/add/novice/index.html"</span>)]
</span><span class="kw">pub struct </span>EasyIndexPage&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">pub </span>form_description: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
<span class="kw">pub </span>form_title: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
<span class="kw">pub </span>peak_sustainable_traffic: <span class="prelude-ty">Option</span>&lt;usize&gt;,
<span class="kw">pub </span>avg_traffic: <span class="prelude-ty">Option</span>&lt;usize&gt;,
<span class="kw">pub </span>broke_my_site_traffic: <span class="prelude-ty">Option</span>&lt;usize&gt;,
}
<span class="kw">impl</span>&lt;<span class="lifetime">&#39;a</span>&gt; Default <span class="kw">for </span>EasyIndexPage&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">impl</span>&lt;<span class="lifetime">'a</span>&gt; Default <span class="kw">for </span>EasyIndexPage&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">fn </span>default() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
form_description: <span class="string">&quot;&quot;</span>,
form_description: <span class="string">""</span>,
peak_sustainable_traffic: <span class="prelude-val">None</span>,
avg_traffic: <span class="prelude-val">None</span>,
broke_my_site_traffic: <span class="prelude-val">None</span>,
@@ -146,12 +147,12 @@
}
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.sitekey.add_easy&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.sitekey.add_easy"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>easy() -&gt; <span class="kw">impl </span>Responder {
HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(<span class="kw-2">&amp;**</span>EASY_INDEX)
}
</code></pre></div></section></main></body></html>

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/sitekey/delete.rs`."><title>delete.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/sitekey/delete.rs`."><title>delete.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -37,17 +38,17 @@
<span class="kw">use crate</span>::{PAGES, V1_API_ROUTES};
<span class="attr">#[get(
path = <span class="string">&quot;PAGES.panel.sitekey.delete&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"PAGES.panel.sitekey.delete"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>delete_sitekey(path: web::Path&lt;String&gt;) -&gt; <span class="kw">impl </span>Responder {
<span class="kw">let </span>key = path.into_inner();
<span class="kw">let </span>data = <span class="macro">vec!</span>[(<span class="string">&quot;sitekey&quot;</span>, key)];
<span class="kw">let </span>data = <span class="macro">vec!</span>[(<span class="string">"sitekey"</span>, key)];
<span class="kw">let </span>page = SudoPage::new(V1_API_ROUTES.captcha.delete, <span class="prelude-val">Some</span>(data))
.render_once()
.unwrap();
HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(page)
}
</code></pre></div></section></main></body></html>

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/sitekey/edit.rs`."><title>edit.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/sitekey/edit.rs`."><title>edit.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -222,10 +223,10 @@
<span class="kw">use </span><span class="kw">crate</span>::errors::<span class="kw-2">*</span>;
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Edit Sitekey&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Edit Sitekey"</span>;
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/sitekey/edit/advance.html&quot;</span>)]
#[template(path = <span class="string">"panel/sitekey/edit/advance.html"</span>)]
</span><span class="kw">struct </span>AdvanceEditPage {
duration: u32,
name: String,
@@ -253,8 +254,8 @@
<span class="doccomment">/// route handler that renders individual views for sitekeys
</span><span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.sitekey.edit_advance&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.sitekey.edit_advance"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>advance(
path: web::Path&lt;String&gt;,
@@ -272,19 +273,19 @@
.render_once()
.unwrap();
<span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(body))
}
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/sitekey/edit/easy/index.html&quot;</span>)]
</span><span class="kw">pub struct </span>EasyEditPage&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">pub </span>form_title: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
#[template(path = <span class="string">"panel/sitekey/edit/easy/index.html"</span>)]
</span><span class="kw">pub struct </span>EasyEditPage&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">pub </span>form_title: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
<span class="kw">pub </span>pattern: TrafficPatternRequest,
<span class="kw">pub </span>key: String,
}
<span class="kw">impl</span>&lt;<span class="lifetime">&#39;a</span>&gt; EasyEditPage&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">impl</span>&lt;<span class="lifetime">'a</span>&gt; EasyEditPage&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">pub fn </span>new(key: String, pattern: TrafficPatternRequest) -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
form_title: PAGE,
@@ -296,8 +297,8 @@
<span class="doccomment">/// route handler that renders individual views for sitekeys
</span><span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.sitekey.edit_easy&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.sitekey.edit_easy"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>easy(
path: web::Path&lt;String&gt;,
@@ -322,7 +323,7 @@
<span class="kw">let </span>page = EasyEditPage::new(key, pattern).render_once().unwrap();
<span class="kw">return </span><span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(page));
}
<span class="prelude-val">Err</span>(DBError::TrafficPatternNotFound) =&gt; {
@@ -362,9 +363,9 @@
}
<span class="kw">async fn </span>edit_sitekey_work(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;editsitekeyuser&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;longpassworddomain&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;editsitekeyuser@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"editsitekeyuser"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassworddomain"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"editsitekeyuser@a.com"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
delete_user(data, NAME).<span class="kw">await</span>;

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/sitekey/list.rs`."><title>list.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/sitekey/list.rs`."><title>list.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -116,12 +117,12 @@
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/sitekey/list/index.html&quot;</span>)]
#[template(path = <span class="string">"panel/sitekey/list/index.html"</span>)]
</span><span class="kw">pub struct </span>IndexPage {
sitekeys: Vec&lt;Captcha&gt;,
}
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;SiteKeys&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"SiteKeys"</span>;
<span class="kw">impl </span>IndexPage {
<span class="kw">fn </span>new(sitekeys: Vec&lt;Captcha&gt;) -&gt; <span class="self">Self </span>{
@@ -131,15 +132,15 @@
<span class="doccomment">/// render a list of all sitekeys that a user has
</span><span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.sitekey.list&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.sitekey.list"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>list_sitekeys(data: AppData, id: Identity) -&gt; PageResult&lt;<span class="kw">impl </span>Responder&gt; {
<span class="kw">let </span>username = id.identity().unwrap();
<span class="kw">let </span>res = data.db.get_all_user_captchas(<span class="kw-2">&amp;</span>username).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>body = IndexPage::new(res).render_once().unwrap();
<span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(body))
}
@@ -165,9 +166,9 @@
}
<span class="kw">async fn </span>list_sitekeys_work(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;listsitekeyuser&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;longpassworddomain&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;listsitekeyuser@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"listsitekeyuser"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassworddomain"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"listsitekeyuser@a.com"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
delete_user(data, NAME).<span class="kw">await</span>;

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/sitekey/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/sitekey/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -98,46 +99,46 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Sitekey {
<span class="kw">pub </span>list: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>add_easy: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>add_advance: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>view: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>edit_easy: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>edit_advance: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>delete: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>list: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>add_easy: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>add_advance: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>view: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>edit_easy: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>edit_advance: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>delete: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Sitekey {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
Sitekey {
list: <span class="string">&quot;/sitekeys&quot;</span>,
add_advance: <span class="string">&quot;/sitekeys/advance/add&quot;</span>,
add_easy: <span class="string">&quot;/sitekeys/easy/add&quot;</span>,
view: <span class="string">&quot;/sitekey/{key}&quot;</span>,
edit_advance: <span class="string">&quot;/sitekey/{key}/advance/edit&quot;</span>,
edit_easy: <span class="string">&quot;/sitekey/{key}/easy/edit&quot;</span>,
delete: <span class="string">&quot;/sitekey/{key}/delete&quot;</span>,
list: <span class="string">"/sitekeys"</span>,
add_advance: <span class="string">"/sitekeys/advance/add"</span>,
add_easy: <span class="string">"/sitekeys/easy/add"</span>,
view: <span class="string">"/sitekey/{key}"</span>,
edit_advance: <span class="string">"/sitekey/{key}/advance/edit"</span>,
edit_easy: <span class="string">"/sitekey/{key}/easy/edit"</span>,
delete: <span class="string">"/sitekey/{key}/delete"</span>,
}
}
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str; <span class="number">2</span>] {
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">'static </span>str; <span class="number">2</span>] {
<span class="kw">const </span>S: Sitekey = Sitekey::new();
[S.list, S.add_advance]
}
<span class="kw">pub fn </span>get_edit_easy(<span class="kw-2">&amp;</span><span class="self">self</span>, key: <span class="kw-2">&amp;</span>str) -&gt; String {
<span class="self">self</span>.edit_easy.replace(<span class="string">&quot;{key}&quot;</span>, key)
<span class="self">self</span>.edit_easy.replace(<span class="string">"{key}"</span>, key)
}
<span class="kw">pub fn </span>get_edit_advance(<span class="kw-2">&amp;</span><span class="self">self</span>, key: <span class="kw-2">&amp;</span>str) -&gt; String {
<span class="self">self</span>.edit_advance.replace(<span class="string">&quot;{key}&quot;</span>, key)
<span class="self">self</span>.edit_advance.replace(<span class="string">"{key}"</span>, key)
}
<span class="kw">pub fn </span>get_view(<span class="kw-2">&amp;</span><span class="self">self</span>, key: <span class="kw-2">&amp;</span>str) -&gt; String {
<span class="self">self</span>.view.replace(<span class="string">&quot;{key}&quot;</span>, key)
<span class="self">self</span>.view.replace(<span class="string">"{key}"</span>, key)
}
<span class="kw">pub fn </span>get_delete(<span class="kw-2">&amp;</span><span class="self">self</span>, key: <span class="kw-2">&amp;</span>str) -&gt; String {
<span class="self">self</span>.delete.replace(<span class="string">&quot;{key}&quot;</span>, key)
<span class="self">self</span>.delete.replace(<span class="string">"{key}"</span>, key)
}
}
}
@@ -159,12 +160,12 @@
<span class="attr">#[test]
</span><span class="kw">fn </span>get_sitekey_routes_work() {
<span class="kw">const </span>ROUTES: Sitekey = Sitekey::new();
<span class="kw">const </span>KEY: <span class="kw-2">&amp;</span>str = <span class="string">&quot;foo&quot;</span>;
<span class="kw">const </span>KEY: <span class="kw-2">&amp;</span>str = <span class="string">"foo"</span>;
<span class="kw">let </span>tests = [
(ROUTES.get_edit_easy(KEY), <span class="string">&quot;/sitekey/foo/easy/edit&quot;</span>),
(ROUTES.get_edit_advance(KEY), <span class="string">&quot;/sitekey/foo/advance/edit&quot;</span>),
(ROUTES.get_view(KEY), <span class="string">&quot;/sitekey/foo&quot;</span>),
(ROUTES.get_delete(KEY), <span class="string">&quot;/sitekey/foo/delete&quot;</span>),
(ROUTES.get_edit_easy(KEY), <span class="string">"/sitekey/foo/easy/edit"</span>),
(ROUTES.get_edit_advance(KEY), <span class="string">"/sitekey/foo/advance/edit"</span>),
(ROUTES.get_view(KEY), <span class="string">"/sitekey/foo"</span>),
(ROUTES.get_delete(KEY), <span class="string">"/sitekey/foo/delete"</span>),
];
<span class="kw">for </span>(r, l) <span class="kw">in </span>tests.iter() {

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/sitekey/view.rs`."><title>view.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/sitekey/view.rs`."><title>view.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../../src-files.js"></script><script defer src="../../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -146,10 +147,10 @@
<span class="kw">use </span><span class="kw">crate</span>::stats::CaptchaStats;
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;SiteKeys&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"SiteKeys"</span>;
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/sitekey/view/index.html&quot;</span>)]
#[template(path = <span class="string">"panel/sitekey/view/index.html"</span>)]
</span><span class="kw">struct </span>IndexPage {
duration: u32,
name: String,
@@ -180,8 +181,8 @@
<span class="doccomment">/// route handler that renders individual views for sitekeys
</span><span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.sitekey.view&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.sitekey.view"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>view_sitekey(
path: web::Path&lt;String&gt;,
@@ -199,7 +200,7 @@
.render_once()
.unwrap();
<span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(body))
}
@@ -225,9 +226,9 @@
}
<span class="kw">async fn </span>view_sitekey_work(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;viewsitekeyuser&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;longpassworddomain&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;viewsitekeyuser@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"viewsitekeyuser"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassworddomain"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"viewsitekeyuser@a.com"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
delete_user(data, NAME).<span class="kw">await</span>;
@@ -238,7 +239,7 @@
<span class="kw">let </span>app = <span class="macro">get_app!</span>(data).<span class="kw">await</span>;
<span class="kw">let </span>url = <span class="macro">format!</span>(<span class="string">&quot;/sitekey/{}/&quot;</span>, <span class="kw-2">&amp;</span>key.key);
<span class="kw">let </span>url = <span class="macro">format!</span>(<span class="string">"/sitekey/{}/"</span>, <span class="kw-2">&amp;</span>key.key);
<span class="kw">let </span>list_sitekey_resp = test::call_service(
<span class="kw-2">&amp;</span>app,

View File

@@ -1,4 +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="Source of the Rust file `src/pages/panel/utils.rs`."><title>utils.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/panel/utils.rs`."><title>utils.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -294,17 +295,17 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Utils {
<span class="kw">pub </span>percentile: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>percentile: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Utils {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
Utils {
percentile: <span class="string">&quot;/utils/percentile&quot;</span>,
percentile: <span class="string">"/utils/percentile"</span>,
}
}
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str; <span class="number">1</span>] {
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">'static </span>str; <span class="number">1</span>] {
<span class="kw">const </span>S: Utils = Utils::new();
[S.percentile]
}
@@ -316,10 +317,10 @@
cfg.service(post_percentile);
}
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Difficulty factor statistics&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"Difficulty factor statistics"</span>;
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;panel/utils/percentile/index.html&quot;</span>)]
#[template(path = <span class="string">"panel/utils/percentile/index.html"</span>)]
</span><span class="kw">pub struct </span>PercentilePage {
time: <span class="prelude-ty">Option</span>&lt;u32&gt;,
percentile: <span class="prelude-ty">Option</span>&lt;f64&gt;,
@@ -327,8 +328,8 @@
}
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::PAGES.panel.utils.percentile&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.utils.percentile"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>get_percentile(id: Identity) -&gt; PageResult&lt;<span class="kw">impl </span>Responder&gt; {
<span class="kw">let </span>data = PercentilePage {
@@ -339,13 +340,13 @@
<span class="kw">let </span>body = data.render_once().unwrap();
<span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(body))
}
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::PAGES.panel.utils.percentile&quot;</span>,
wrap = <span class="string">&quot;crate::pages::get_middleware()&quot;
path = <span class="string">"crate::PAGES.panel.utils.percentile"</span>,
wrap = <span class="string">"crate::pages::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>post_percentile(
data: AppData,
@@ -361,7 +362,7 @@
<span class="kw">let </span>body = page.render_once().unwrap();
<span class="prelude-val">Ok</span>(HttpResponse::Ok()
.content_type(<span class="string">&quot;text/html; charset=utf-8&quot;</span>)
.content_type(<span class="string">"text/html; charset=utf-8"</span>)
.body(body))
}
@@ -388,12 +389,12 @@
<span class="kw">async fn </span>page_stats_bench_work(data: ArcData) {
<span class="kw">use </span><span class="kw">crate</span>::tests::<span class="kw-2">*</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;pagebenchstatsuesr&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;pagebenchstatsuesr@testadminuser.com&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;longpassword2&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"pagebenchstatsuesr"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"pagebenchstatsuesr@testadminuser.com"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassword2"</span>;
<span class="kw">const </span>DEVICE_USER_PROVIDED: <span class="kw-2">&amp;</span>str = <span class="string">&quot;foo&quot;</span>;
<span class="kw">const </span>DEVICE_SOFTWARE_RECOGNISED: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Foobar.v2&quot;</span>;
<span class="kw">const </span>DEVICE_USER_PROVIDED: <span class="kw-2">&amp;</span>str = <span class="string">"foo"</span>;
<span class="kw">const </span>DEVICE_SOFTWARE_RECOGNISED: <span class="kw-2">&amp;</span>str = <span class="string">"Foobar.v2"</span>;
<span class="kw">const </span>THREADS: i32 = <span class="number">4</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
@@ -432,11 +433,11 @@
</span>.unwrap();
<span class="kw">for </span>i <span class="kw">in </span><span class="number">1</span>..<span class="number">6 </span>{
<span class="macro">println!</span>(<span class="string">&quot;[{i}] Saving analytics&quot;</span>);
<span class="macro">println!</span>(<span class="string">"[{i}] Saving analytics"</span>);
<span class="kw">let </span>analytics = db_core::CreatePerformanceAnalytics {
time: i,
difficulty_factor: i,
worker_type: <span class="string">&quot;wasm&quot;</span>.into(),
worker_type: <span class="string">"wasm"</span>.into(),
};
data.db.analysis_save(<span class="kw-2">&amp;</span>key.key, <span class="kw-2">&amp;</span>analytics).<span class="kw">await</span>.unwrap();
}
@@ -483,7 +484,7 @@
<span class="kw">let </span>body: Bytes = test::read_body(percentile_resp).<span class="kw">await</span>;
<span class="kw">let </span>body = String::from_utf8(body.to_vec()).unwrap();
<span class="macro">assert!</span>(body.contains(<span class="string">&quot;Maximum time taken&quot;</span>));
<span class="macro">assert!</span>(body.contains(<span class="string">"Maximum time taken"</span>));
<span class="kw">let </span>percentile_resp = test::call_service(
<span class="kw-2">&amp;</span>app,
@@ -499,7 +500,7 @@
<span class="kw">let </span>body: Bytes = test::read_body(percentile_resp).<span class="kw">await</span>;
<span class="kw">let </span>body = String::from_utf8(body.to_vec()).unwrap();
<span class="macro">assert!</span>(body.contains(<span class="string">&quot;Maximum time taken&quot;</span>));
<span class="macro">assert!</span>(body.contains(<span class="string">"Maximum time taken"</span>));
<span class="comment">// end
// start post
@@ -525,7 +526,7 @@
<span class="kw">let </span>body = String::from_utf8(body.to_vec()).unwrap();
<span class="macro">assert!</span>(body.contains(
<span class="string">&quot;Not enough inputs to compute statistics. Please try again later&quot;
<span class="string">"Not enough inputs to compute statistics. Please try again later"
</span>));
<span class="macro">assert!</span>(body.contains(<span class="kw-2">&amp;</span><span class="number">1</span>.to_string()));
<span class="macro">assert!</span>(body.contains(<span class="kw-2">&amp;</span><span class="number">99.00</span>.to_string()));
@@ -553,7 +554,7 @@
<span class="kw">let </span>body: Bytes = test::read_body(percentile_resp).<span class="kw">await</span>;
<span class="kw">let </span>body = String::from_utf8(body.to_vec()).unwrap();
<span class="macro">assert!</span>(body.contains(<span class="string">&quot;Difficulty factor: 2&quot;</span>));
<span class="macro">assert!</span>(body.contains(<span class="string">"Difficulty factor: 2"</span>));
<span class="macro">assert!</span>(body.contains(<span class="kw-2">&amp;</span><span class="number">2</span>.to_string()));
<span class="macro">assert!</span>(body.contains(<span class="kw-2">&amp;</span><span class="number">100.00</span>.to_string()));
}

View File

@@ -1,4 +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="Source of the Rust file `src/pages/routes.rs`."><title>routes.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/routes.rs`."><title>routes.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -78,16 +79,16 @@
<span class="kw">pub const </span>ROUTES: Routes = Routes::new();
<span class="kw">pub struct </span>Routes {
<span class="kw">pub </span>home: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>home: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>auth: Auth,
<span class="kw">pub </span>panel: Panel,
<span class="kw">pub </span>errors: Errors,
<span class="kw">pub </span>about: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>sitemap: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>thanks: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>donate: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>security: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>privacy: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>about: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>sitemap: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>thanks: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>donate: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>security: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>privacy: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Routes {
@@ -99,16 +100,16 @@
panel,
home,
errors: Errors::new(),
about: <span class="string">&quot;/about&quot;</span>,
sitemap: <span class="string">&quot;/sitemap.xml&quot;</span>,
thanks: <span class="string">&quot;/thanks&quot;</span>,
donate: <span class="string">&quot;/donate&quot;</span>,
security: <span class="string">&quot;/security&quot;</span>,
privacy: <span class="string">&quot;/privacy-policy&quot;</span>,
about: <span class="string">"/about"</span>,
sitemap: <span class="string">"/sitemap.xml"</span>,
thanks: <span class="string">"/thanks"</span>,
donate: <span class="string">"/donate"</span>,
security: <span class="string">"/security"</span>,
privacy: <span class="string">"/privacy-policy"</span>,
}
}
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str; <span class="number">7</span>] {
<span class="kw">pub const fn </span>get_sitemap() -&gt; [<span class="kw-2">&amp;</span><span class="lifetime">'static </span>str; <span class="number">7</span>] {
<span class="kw">let </span>a = Auth::get_sitemap();
<span class="kw">let </span>p = Panel::get_sitemap();
[a[<span class="number">0</span>], a[<span class="number">1</span>], p[<span class="number">0</span>], p[<span class="number">1</span>], p[<span class="number">2</span>], p[<span class="number">3</span>], p[<span class="number">4</span>]]

View File

@@ -1,4 +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="Source of the Rust file `src/pages/sitemap.rs`."><title>sitemap.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-9ee3a5e31a2afa3e.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0 (82e1608df 2023-12-21)" data-channel="1.75.0" data-search-js="search-8fbf244ebcf71464.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-9dd44ab47b99a0fb.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<!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="Source of the Rust file `src/pages/sitemap.rs`."><title>sitemap.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="mcaptcha" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../../../static.files/src-script-39ed315d46fb705f.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><div class="sidebar-resizer"></div>
<main><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
@@ -55,16 +56,16 @@
<span class="kw">use </span><span class="kw">crate</span>::PAGES;
<span class="attr">#[derive(Clone, TemplateOnce)]
#[template(path = <span class="string">&quot;sitemap.html&quot;</span>)]
#[template(path = <span class="string">"sitemap.html"</span>)]
</span><span class="kw">struct </span>IndexPage {
urls: [<span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str; <span class="number">7</span>],
domain: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
urls: [<span class="kw-2">&amp;</span><span class="lifetime">'static </span>str; <span class="number">7</span>],
domain: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Default <span class="kw">for </span>IndexPage {
<span class="kw">fn </span>default() -&gt; <span class="self">Self </span>{
<span class="kw">let </span>urls = Routes::get_sitemap();
<span class="kw">let </span>domain = <span class="kw">if </span><span class="kw">crate</span>::SETTINGS.server.domain.ends_with(<span class="string">&#39;/&#39;</span>) {
<span class="kw">let </span>domain = <span class="kw">if </span><span class="kw">crate</span>::SETTINGS.server.domain.ends_with(<span class="string">'/'</span>) {
<span class="kw-2">&amp;</span><span class="kw">crate</span>::SETTINGS.server.domain[<span class="number">0</span>..<span class="kw">crate</span>::SETTINGS.server.domain.len() - <span class="number">1</span>]
} <span class="kw">else </span>{
<span class="kw-2">&amp;</span><span class="kw">crate</span>::SETTINGS.server.domain
@@ -78,10 +79,10 @@
<span class="kw">static </span><span class="kw-2">ref </span>INDEX: String = IndexPage::default().render_once().unwrap();
}
<span class="attr">#[get(path = <span class="string">&quot;PAGES.sitemap&quot;</span>)]
<span class="attr">#[get(path = <span class="string">"PAGES.sitemap"</span>)]
</span><span class="kw">pub async fn </span>sitemap() -&gt; <span class="kw">impl </span>Responder {
HttpResponse::Ok()
.content_type(<span class="string">&quot;application/xml; charset=utf-8&quot;</span>)
.content_type(<span class="string">"application/xml; charset=utf-8"</span>)
.body(<span class="kw-2">&amp;**</span>INDEX)
}
</code></pre></div></section></main></body></html>