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/api/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/api/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>

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/api/v1/account/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/api/v1/account/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>
@@ -63,8 +64,8 @@
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.account.delete&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.account.delete"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>delete_account(
id: Identity,

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/api/v1/account/email.rs`."><title>email.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/api/v1/account/email.rs`."><title>email.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>
@@ -76,7 +77,7 @@
<span class="kw">pub </span>email: String,
}
<span class="attr">#[my_codegen::post(path = <span class="string">&quot;crate::V1_API_ROUTES.account.email_exists&quot;</span>)]
<span class="attr">#[my_codegen::post(path = <span class="string">"crate::V1_API_ROUTES.account.email_exists"</span>)]
</span><span class="kw">pub async fn </span>email_exists(
payload: web::Json&lt;AccountCheckPayload&gt;,
data: AppData,
@@ -90,8 +91,8 @@
<span class="doccomment">/// update email
</span><span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.account.update_email&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.account.update_email"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>set_email(
id: Identity,

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/api/v1/account/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/api/v1/account/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>
@@ -91,26 +92,26 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Account {
<span class="kw">pub </span>delete: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>email_exists: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>get_secret: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>update_email: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>update_password: <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>username_exists: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>update_username: <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">'static </span>str,
<span class="kw">pub </span>email_exists: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>get_secret: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>update_email: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>update_password: <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">pub </span>username_exists: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>update_username: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Account {
<span class="kw">pub const fn </span>new() -&gt; Account {
<span class="kw">let </span>get_secret = <span class="string">&quot;/api/v1/account/secret/get&quot;</span>;
<span class="kw">let </span>update_secret = <span class="string">&quot;/api/v1/account/secret/update&quot;</span>;
<span class="kw">let </span>delete = <span class="string">&quot;/api/v1/account/delete&quot;</span>;
<span class="kw">let </span>email_exists = <span class="string">&quot;/api/v1/account/email/exists&quot;</span>;
<span class="kw">let </span>username_exists = <span class="string">&quot;/api/v1/account/username/exists&quot;</span>;
<span class="kw">let </span>update_username = <span class="string">&quot;/api/v1/account/username/update&quot;</span>;
<span class="kw">let </span>update_email = <span class="string">&quot;/api/v1/account/email/update&quot;</span>;
<span class="kw">let </span>update_password = <span class="string">&quot;/api/v1/account/password/update&quot;</span>;
<span class="kw">let </span>get_secret = <span class="string">"/api/v1/account/secret/get"</span>;
<span class="kw">let </span>update_secret = <span class="string">"/api/v1/account/secret/update"</span>;
<span class="kw">let </span>delete = <span class="string">"/api/v1/account/delete"</span>;
<span class="kw">let </span>email_exists = <span class="string">"/api/v1/account/email/exists"</span>;
<span class="kw">let </span>username_exists = <span class="string">"/api/v1/account/username/exists"</span>;
<span class="kw">let </span>update_username = <span class="string">"/api/v1/account/username/update"</span>;
<span class="kw">let </span>update_email = <span class="string">"/api/v1/account/email/update"</span>;
<span class="kw">let </span>update_password = <span class="string">"/api/v1/account/password/update"</span>;
Account {
delete,
email_exists,

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/api/v1/account/password.rs`."><title>password.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/api/v1/account/password.rs`."><title>password.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>
@@ -245,8 +246,8 @@
}
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.account.update_password&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.account.update_password"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>update_user_password(
id: Identity,
@@ -298,9 +299,9 @@
}
<span class="kw">pub async fn </span>update_password_works(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;updatepassuser&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>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;updatepassuser@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"updatepassuser"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassword2"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"updatepassuser@a.com"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
@@ -310,7 +311,7 @@
<span class="kw">let </span>cookies = <span class="macro">get_cookie!</span>(signin_resp);
<span class="kw">let </span>app = <span class="macro">get_app!</span>(data).<span class="kw">await</span>;
<span class="kw">let </span>new_password = <span class="string">&quot;newpassword&quot;</span>;
<span class="kw">let </span>new_password = <span class="string">"newpassword"</span>;
<span class="kw">let </span>update_password = ChangePasswordReqest {
password: PASSWORD.into(),

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/api/v1/account/secret.rs`."><title>secret.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/api/v1/account/secret.rs`."><title>secret.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>
@@ -64,8 +65,8 @@
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::V1_API_ROUTES.account.get_secret&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.account.get_secret"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>get_secret(id: Identity, data: AppData) -&gt; ServiceResult&lt;<span class="kw">impl </span>Responder&gt; {
<span class="kw">let </span>username = id.identity().unwrap();
@@ -74,8 +75,8 @@
}
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.account.update_secret&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.account.update_secret"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>update_user_secret(
id: Identity,

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/api/v1/account/username.rs`."><title>username.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/api/v1/account/username.rs`."><title>username.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>
@@ -77,7 +78,7 @@
<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="attr">#[my_codegen::post(path = <span class="string">&quot;crate::V1_API_ROUTES.account.username_exists&quot;</span>)]
<span class="attr">#[my_codegen::post(path = <span class="string">"crate::V1_API_ROUTES.account.username_exists"</span>)]
</span><span class="kw">async fn </span>username_exists(
payload: web::Json&lt;AccountCheckPayload&gt;,
data: AppData,
@@ -106,8 +107,8 @@
<span class="doccomment">/// update username
</span><span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.account.update_username&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.account.update_username"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>set_username(
id: Identity,

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/api/v1/auth.rs`."><title>auth.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/api/v1/auth.rs`."><title>auth.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>
@@ -207,16 +208,16 @@
<span class="kw">use </span>actix_auth_middleware::GetLoginRoute;
<span class="kw">pub struct </span>Auth {
<span class="kw">pub </span>logout: <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">&#39;static </span>str,
<span class="kw">pub </span>register: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>logout: <span class="kw-2">&amp;</span><span class="lifetime">'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>register: <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 {
<span class="kw">let </span>login = <span class="string">&quot;/api/v1/signin&quot;</span>;
<span class="kw">let </span>logout = <span class="string">&quot;/logout&quot;</span>;
<span class="kw">let </span>register = <span class="string">&quot;/api/v1/signup&quot;</span>;
<span class="kw">let </span>login = <span class="string">"/api/v1/signin"</span>;
<span class="kw">let </span>logout = <span class="string">"/logout"</span>;
<span class="kw">let </span>register = <span class="string">"/api/v1/signup"</span>;
Auth {
logout,
login,
@@ -229,7 +230,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)
)
@@ -253,7 +254,7 @@
<span class="attr">#[derive(Clone, Debug, Deserialize, Serialize)]
</span><span class="kw">pub struct </span>Login {
<span class="comment">// login accepts both username and email under &quot;username field&quot;
<span class="comment">// login accepts both username and email under "username field"
// TODO update all instances where login is used
</span><span class="kw">pub </span>login: String,
<span class="kw">pub </span>password: String,
@@ -276,7 +277,7 @@
}
};
<span class="kw">let </span>s = <span class="kw">if </span>payload.login.contains(<span class="string">&#39;@&#39;</span>) {
<span class="kw">let </span>s = <span class="kw">if </span>payload.login.contains(<span class="string">'@'</span>) {
data.db
.get_password(<span class="kw-2">&amp;</span>db_core::Login::Email(<span class="kw-2">&amp;</span>payload.login))
.<span class="kw">await</span><span class="question-mark">?
@@ -336,7 +337,7 @@
cfg.service(login);
cfg.service(signout);
}
<span class="attr">#[my_codegen::post(path = <span class="string">&quot;crate::V1_API_ROUTES.auth.register&quot;</span>)]
<span class="attr">#[my_codegen::post(path = <span class="string">"crate::V1_API_ROUTES.auth.register"</span>)]
</span><span class="kw">async fn </span>register(
payload: web::Json&lt;runners::Register&gt;,
data: AppData,
@@ -345,7 +346,7 @@
<span class="prelude-val">Ok</span>(HttpResponse::Ok())
}
<span class="attr">#[my_codegen::post(path = <span class="string">&quot;crate::V1_API_ROUTES.auth.login&quot;</span>)]
<span class="attr">#[my_codegen::post(path = <span class="string">"crate::V1_API_ROUTES.auth.login"</span>)]
</span><span class="kw">async fn </span>login(
id: Identity,
payload: web::Json&lt;runners::Login&gt;,
@@ -367,8 +368,8 @@
}
<span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::V1_API_ROUTES.auth.logout&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.auth.logout"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>signout(id: Identity) -&gt; <span class="kw">impl </span>Responder {
<span class="kw">if </span>id.identity().is_some() {

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/api/v1/mcaptcha/create.rs`."><title>create.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/api/v1/mcaptcha/create.rs`."><title>create.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>
@@ -134,8 +135,8 @@
<span class="comment">// TODO redo mcaptcha table to include levels as json field
// so that the whole thing can be added/udpaed in a single stroke
</span><span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.captcha.create&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.captcha.create"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>create(
payload: web::Json&lt;CreateCaptcha&gt;,

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/api/v1/mcaptcha/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/api/v1/mcaptcha/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>
@@ -67,8 +68,8 @@
}
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.captcha.delete&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.captcha.delete"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>delete(
payload: web::Json&lt;DeleteCaptcha&gt;,
@@ -88,7 +89,7 @@
data.db.delete_captcha(<span class="kw-2">&amp;</span>username, <span class="kw-2">&amp;</span>payload.key).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">if let </span><span class="prelude-val">Err</span>(err) = data.captcha.remove(RemoveCaptcha(payload.key)).<span class="kw">await </span>{
<span class="macro">log::error!</span>(<span class="string">&quot;Error while trying to remove captcha from cache {}&quot;</span>, err);
<span class="macro">log::error!</span>(<span class="string">"Error while trying to remove captcha from cache {}"</span>, err);
}
<span class="prelude-val">Ok</span>(HttpResponse::Ok())
}

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/api/v1/mcaptcha/easy.rs`."><title>easy.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/api/v1/mcaptcha/easy.rs`."><title>easy.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>
@@ -557,15 +558,15 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Easy {
<span class="doccomment">/// easy is using defaults
</span><span class="kw">pub </span>create: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>update: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
</span><span class="kw">pub </span>create: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>update: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Easy {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
create: <span class="string">&quot;/api/v1/mcaptcha/add/easy&quot;</span>,
update: <span class="string">&quot;/api/v1/mcaptcha/update/easy&quot;</span>,
create: <span class="string">"/api/v1/mcaptcha/add/easy"</span>,
update: <span class="string">"/api/v1/mcaptcha/update/easy"</span>,
}
}
}
@@ -577,13 +578,13 @@
}
<span class="attr">#[derive(Default, Serialize, Deserialize, Clone, Debug)]
</span><span class="doccomment">/// User&#39;s traffic pattern; used in generating a captcha configuration
</span><span class="doccomment">/// User's traffic pattern; used in generating a captcha configuration
</span><span class="kw">pub struct </span>TrafficPatternRequest {
<span class="doccomment">/// average traffic of user&#39;s website
<span class="doccomment">/// average traffic of user's website
</span><span class="kw">pub </span>avg_traffic: u32,
<span class="doccomment">/// the peak traffic that the user&#39;s website can handle
<span class="doccomment">/// the peak traffic that the user's website can handle
</span><span class="kw">pub </span>peak_sustainable_traffic: u32,
<span class="doccomment">/// traffic that bought the user&#39;s website down; optional
<span class="doccomment">/// traffic that bought the user's website down; optional
</span><span class="kw">pub </span>broke_my_site_traffic: <span class="prelude-ty">Option</span>&lt;u32&gt;,
<span class="doccomment">/// Captcha description
</span><span class="kw">pub </span>description: String,
@@ -713,8 +714,8 @@
}
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.captcha.easy.create&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.captcha.easy.create"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>create(
payload: web::Json&lt;TrafficPatternRequest&gt;,
@@ -752,8 +753,8 @@
}
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.captcha.easy.update&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.captcha.easy.update"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">async fn </span>update(
payload: web::Json&lt;UpdateTrafficPattern&gt;,
@@ -894,9 +895,9 @@
}
<span class="kw">pub async fn </span>easy_works(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;defaultuserconfgworks&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;defaultuserconfgworks@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"defaultuserconfgworks"</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">"defaultuserconfgworks@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/api/v1/mcaptcha/get.rs`."><title>get.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/api/v1/mcaptcha/get.rs`."><title>get.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>
@@ -54,8 +55,8 @@
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.captcha.get&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.captcha.get"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>get_captcha(
payload: web::Json&lt;MCaptchaDetails&gt;,

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/api/v1/mcaptcha/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/api/v1/mcaptcha/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>
@@ -107,11 +108,11 @@
<span class="kw">use </span><span class="kw">super</span>::stats::routes::Stats;
<span class="kw">pub struct </span>Captcha {
<span class="kw">pub </span>create: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>update: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>get: <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>update_key: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>create: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>update: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>get: <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">pub </span>update_key: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>easy: Easy,
<span class="kw">pub </span>stats: Stats,
}
@@ -119,11 +120,11 @@
<span class="kw">impl </span>Captcha {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
create: <span class="string">&quot;/api/v1/mcaptcha/create&quot;</span>,
update: <span class="string">&quot;/api/v1/mcaptcha/update&quot;</span>,
get: <span class="string">&quot;/api/v1/mcaptcha/get&quot;</span>,
update_key: <span class="string">&quot;/api/v1/mcaptcha/update/key&quot;</span>,
delete: <span class="string">&quot;/api/v1/mcaptcha/delete&quot;</span>,
create: <span class="string">"/api/v1/mcaptcha/create"</span>,
update: <span class="string">"/api/v1/mcaptcha/update"</span>,
get: <span class="string">"/api/v1/mcaptcha/get"</span>,
update_key: <span class="string">"/api/v1/mcaptcha/update/key"</span>,
delete: <span class="string">"/api/v1/mcaptcha/delete"</span>,
easy: Easy::new(),
stats: Stats::new(),
}

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/api/v1/mcaptcha/stats.rs`."><title>stats.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/api/v1/mcaptcha/stats.rs`."><title>stats.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,13 +56,13 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Stats {
<span class="kw">pub </span>get: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>get: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Stats {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
get: <span class="string">&quot;/api/v1/mcaptcha/stats&quot;</span>,
get: <span class="string">"/api/v1/mcaptcha/stats"</span>,
}
}
}
@@ -72,8 +73,8 @@
}
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.captcha.stats.get&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.captcha.stats.get"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>get(
payload: web::Json&lt;StatsPayload&gt;,

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/api/v1/mcaptcha/update.rs`."><title>update.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/api/v1/mcaptcha/update.rs`."><title>update.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>
@@ -235,8 +236,8 @@
<span class="kw">use </span><span class="kw">crate</span>::AppData;
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.captcha.update_key&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.captcha.update_key"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>update_key(
payload: web::Json&lt;MCaptchaDetails&gt;,
@@ -286,8 +287,8 @@
}
<span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.captcha.update&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.captcha.update"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>update_captcha(
payload: web::Json&lt;UpdateCaptcha&gt;,
@@ -341,7 +342,7 @@
.<span class="kw">await
</span>{
<span class="macro">log::error!</span>(
<span class="string">&quot;Deleting captcha key {} while updating it, error: {:?}&quot;</span>,
<span class="string">"Deleting captcha key {} while updating it, error: {:?}"</span>,
<span class="kw-2">&amp;</span>payload.key,
e
);
@@ -384,9 +385,9 @@
}
<span class="kw">async fn </span>update_and_get_mcaptcha_works(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;updateusermcaptcha&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;testupdateusermcaptcha@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"updateusermcaptcha"</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">"testupdateusermcaptcha@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>;
@@ -416,7 +417,7 @@
.to_request(),
)
.<span class="kw">await</span>;
<span class="comment">// if updated key doesn&#39;t exist in database, a non 200 result will bereturned
<span class="comment">// if updated key doesn't exist in database, a non 200 result will bereturned
</span><span class="macro">assert_eq!</span>(get_token_resp.status(), StatusCode::OK);
<span class="comment">// get stats
@@ -428,7 +429,7 @@
.to_request(),
)
.<span class="kw">await</span>;
<span class="comment">// if updated key doesn&#39;t exist in database, a non 200 result will bereturned
<span class="comment">// if updated key doesn't exist in database, a non 200 result will bereturned
</span><span class="macro">assert_eq!</span>(get_statis_resp.status(), StatusCode::OK);
}
}

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/api/v1/meta.rs`."><title>meta.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/api/v1/meta.rs`."><title>meta.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>
@@ -156,28 +157,28 @@
<span class="attr">#[derive(Clone, Debug, Deserialize, Builder, Serialize)]
</span><span class="kw">pub struct </span>BuildDetails {
<span class="kw">pub </span>version: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>git_commit_hash: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>version: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>git_commit_hash: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Meta {
<span class="kw">pub </span>build_details: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>health: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>build_details: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>health: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Meta {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
build_details: <span class="string">&quot;/api/v1/meta/build&quot;</span>,
health: <span class="string">&quot;/api/v1/meta/health&quot;</span>,
build_details: <span class="string">"/api/v1/meta/build"</span>,
health: <span class="string">"/api/v1/meta/health"</span>,
}
}
}
}
<span class="doccomment">/// emits build details of the bninary
</span><span class="attr">#[my_codegen::get(path = <span class="string">&quot;crate::V1_API_ROUTES.meta.build_details&quot;</span>)]
</span><span class="attr">#[my_codegen::get(path = <span class="string">"crate::V1_API_ROUTES.meta.build_details"</span>)]
</span><span class="kw">async fn </span>build_details() -&gt; <span class="kw">impl </span>Responder {
<span class="kw">let </span>build = BuildDetails {
version: VERSION,
@@ -190,7 +191,7 @@
</span><span class="doccomment">/// Health check return datatype
</span><span class="kw">pub struct </span>Health {
db: bool,
<span class="attr">#[serde(skip_serializing_if = <span class="string">&quot;Self::is_redis&quot;</span>)]
<span class="attr">#[serde(skip_serializing_if = <span class="string">"Self::is_redis"</span>)]
</span>redis: <span class="prelude-ty">Option</span>&lt;bool&gt;,
}
@@ -201,7 +202,7 @@
}
<span class="doccomment">/// checks all components of the system
</span><span class="attr">#[my_codegen::get(path = <span class="string">&quot;crate::V1_API_ROUTES.meta.health&quot;</span>)]
</span><span class="attr">#[my_codegen::get(path = <span class="string">"crate::V1_API_ROUTES.meta.health"</span>)]
</span><span class="kw">async fn </span>health(data: AppData) -&gt; <span class="kw">impl </span>Responder {
<span class="kw">let </span><span class="kw-2">mut </span>resp_builder = HealthBuilder::default();
resp_builder.redis(<span class="prelude-val">None</span>);
@@ -264,7 +265,7 @@
}
<span class="kw">pub async fn </span>health_works(data: ArcData) {
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, V1_API_ROUTES.meta.health);
<span class="macro">println!</span>(<span class="string">"{}"</span>, V1_API_ROUTES.meta.health);
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
<span class="kw">let </span>app = <span class="macro">get_app!</span>(data).<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/api/v1/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/api/v1/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>

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/api/v1/notifications/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/api/v1/notifications/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>
@@ -122,8 +123,8 @@
<span class="doccomment">/// route handler that adds a notification message
</span><span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.notifications.add&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.notifications.add"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>add_notification(
payload: web::Json&lt;AddNotificationRequest&gt;,
@@ -131,7 +132,7 @@
id: Identity,
) -&gt; ServiceResult&lt;<span class="kw">impl </span>Responder&gt; {
<span class="kw">let </span>sender = 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
</span><span class="kw">let </span>p = AddNotification {
from: <span class="kw-2">&amp;</span>sender,
@@ -167,11 +168,11 @@
}
<span class="kw">pub async fn </span>notification_works(data: ArcData) {
<span class="kw">const </span>NAME1: <span class="kw-2">&amp;</span>str = <span class="string">&quot;notifuser1&quot;</span>;
<span class="kw">const </span>NAME2: <span class="kw-2">&amp;</span>str = <span class="string">&quot;notiuser2&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>EMAIL1: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testnotification1@a.com&quot;</span>;
<span class="kw">const </span>EMAIL2: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testnotification2@a.com&quot;</span>;
<span class="kw">const </span>NAME1: <span class="kw-2">&amp;</span>str = <span class="string">"notifuser1"</span>;
<span class="kw">const </span>NAME2: <span class="kw-2">&amp;</span>str = <span class="string">"notiuser2"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassworddomain"</span>;
<span class="kw">const </span>EMAIL1: <span class="kw-2">&amp;</span>str = <span class="string">"testnotification1@a.com"</span>;
<span class="kw">const </span>EMAIL2: <span class="kw-2">&amp;</span>str = <span class="string">"testnotification2@a.com"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
@@ -186,8 +187,8 @@
<span class="kw">let </span>msg = AddNotificationRequest {
to: NAME2.into(),
heading: <span class="string">&quot;Test notification&quot;</span>.into(),
message: <span class="string">&quot;Testing notifications with a dummy message&quot;</span>.into(),
heading: <span class="string">"Test notification"</span>.into(),
message: <span class="string">"Testing notifications with a dummy message"</span>.into(),
};
<span class="kw">let </span>send_notification_resp = test::call_service(

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/api/v1/notifications/get.rs`."><title>get.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/api/v1/notifications/get.rs`."><title>get.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>
@@ -190,15 +191,15 @@
<span class="doccomment">/// route handler that gets all unread notifications
</span><span class="attr">#[my_codegen::get(
path = <span class="string">&quot;crate::V1_API_ROUTES.notifications.get&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.notifications.get"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>get_notification(
data: AppData,
id: Identity,
) -&gt; ServiceResult&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
</span><span class="kw">let </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>;
<span class="kw">let </span>notifications = NotificationResp::from_notifications(notifications);
@@ -228,13 +229,13 @@
}
<span class="kw">pub async fn </span>notification_get_works(data: ArcData) {
<span class="kw">const </span>NAME1: <span class="kw-2">&amp;</span>str = <span class="string">&quot;notifuser12&quot;</span>;
<span class="kw">const </span>NAME2: <span class="kw-2">&amp;</span>str = <span class="string">&quot;notiuser22&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>EMAIL1: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testnotification12@a.com&quot;</span>;
<span class="kw">const </span>EMAIL2: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testnotification22@a.com&quot;</span>;
<span class="kw">const </span>HEADING: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testing notifications get&quot;</span>;
<span class="kw">const </span>MESSAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testing notifications get message&quot;</span>;
<span class="kw">const </span>NAME1: <span class="kw-2">&amp;</span>str = <span class="string">"notifuser12"</span>;
<span class="kw">const </span>NAME2: <span class="kw-2">&amp;</span>str = <span class="string">"notiuser22"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassworddomain"</span>;
<span class="kw">const </span>EMAIL1: <span class="kw-2">&amp;</span>str = <span class="string">"testnotification12@a.com"</span>;
<span class="kw">const </span>EMAIL2: <span class="kw-2">&amp;</span>str = <span class="string">"testnotification22@a.com"</span>;
<span class="kw">const </span>HEADING: <span class="kw-2">&amp;</span>str = <span class="string">"testing notifications get"</span>;
<span class="kw">const </span>MESSAGE: <span class="kw-2">&amp;</span>str = <span class="string">"testing notifications get message"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>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/api/v1/notifications/mark_read.rs`."><title>mark_read.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/api/v1/notifications/mark_read.rs`."><title>mark_read.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>
@@ -157,8 +158,8 @@
<span class="doccomment">/// route handler that marks a notification read
</span><span class="attr">#[my_codegen::post(
path = <span class="string">&quot;crate::V1_API_ROUTES.notifications.mark_read&quot;</span>,
wrap = <span class="string">&quot;crate::api::v1::get_middleware()&quot;
path = <span class="string">"crate::V1_API_ROUTES.notifications.mark_read"</span>,
wrap = <span class="string">"crate::api::v1::get_middleware()"
</span>)]
</span><span class="kw">pub async fn </span>mark_read(
data: AppData,
@@ -166,9 +167,9 @@
id: Identity,
) -&gt; ServiceResult&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
// TODO get payload from path /api/v1/notifications/{id}/read&quot;
// TODO get payload from path /api/v1/notifications/{id}/read"
</span>data.db
.mark_notification_read(<span class="kw-2">&amp;</span>receiver, payload.id)
.<span class="kw">await</span><span class="question-mark">?</span>;
@@ -200,13 +201,13 @@
}
<span class="kw">pub async fn </span>notification_mark_read_works(data: ArcData) {
<span class="kw">const </span>NAME1: <span class="kw-2">&amp;</span>str = <span class="string">&quot;notifuser122&quot;</span>;
<span class="kw">const </span>NAME2: <span class="kw-2">&amp;</span>str = <span class="string">&quot;notiuser222&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>EMAIL1: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testnotification122@a.com&quot;</span>;
<span class="kw">const </span>EMAIL2: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testnotification222@a.com&quot;</span>;
<span class="kw">const </span>HEADING: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testing notifications get&quot;</span>;
<span class="kw">const </span>MESSAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testing notifications get message&quot;</span>;
<span class="kw">const </span>NAME1: <span class="kw-2">&amp;</span>str = <span class="string">"notifuser122"</span>;
<span class="kw">const </span>NAME2: <span class="kw-2">&amp;</span>str = <span class="string">"notiuser222"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"longpassworddomain"</span>;
<span class="kw">const </span>EMAIL1: <span class="kw-2">&amp;</span>str = <span class="string">"testnotification122@a.com"</span>;
<span class="kw">const </span>EMAIL2: <span class="kw-2">&amp;</span>str = <span class="string">"testnotification222@a.com"</span>;
<span class="kw">const </span>HEADING: <span class="kw-2">&amp;</span>str = <span class="string">"testing notifications get"</span>;
<span class="kw">const </span>MESSAGE: <span class="kw-2">&amp;</span>str = <span class="string">"testing notifications get message"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
delete_user(data, NAME1).<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/api/v1/notifications/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/api/v1/notifications/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>
@@ -43,17 +44,17 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Notifications {
<span class="kw">pub </span>add: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>mark_read: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>get: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>add: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>mark_read: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>get: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Notifications {
<span class="kw">pub const fn </span>new() -&gt; Notifications {
Notifications {
add: <span class="string">&quot;/api/v1/notifications/add&quot;</span>,
mark_read: <span class="string">&quot;/api/v1/notifications/read&quot;</span>,
get: <span class="string">&quot;/api/v1/notifications/get&quot;</span>,
add: <span class="string">"/api/v1/notifications/add"</span>,
mark_read: <span class="string">"/api/v1/notifications/read"</span>,
get: <span class="string">"/api/v1/notifications/get"</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/api/v1/pow/get_config.rs`."><title>get_config.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/api/v1/pow/get_config.rs`."><title>get_config.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>
@@ -312,7 +313,7 @@
}
<span class="doccomment">/// get PoW configuration for an mcaptcha key
</span><span class="attr">#[my_codegen::post(path = <span class="string">&quot;V1_API_ROUTES.pow.get_config()&quot;</span>)]
</span><span class="attr">#[my_codegen::post(path = <span class="string">"V1_API_ROUTES.pow.get_config()"</span>)]
</span><span class="kw">pub async fn </span>get_config(
payload: web::Json&lt;GetConfigPayload&gt;,
data: AppData,
@@ -332,7 +333,7 @@
.captcha
.get_pow(payload.key.clone())
.<span class="kw">await
</span>.expect(<span class="string">&quot;mcaptcha should be initialized and ready to go&quot;</span>);
</span>.expect(<span class="string">"mcaptcha should be initialized and ready to go"</span>);
<span class="prelude-val">Ok</span>(config.unwrap())
}
<span class="prelude-val">Err</span>(e) =&gt; <span class="prelude-val">Err</span>(e.into()),
@@ -357,7 +358,7 @@
/// This fn gets mcaptcha config from database, builds [Defense][libmcaptcha::Defense],
/// creates [MCaptcha][libmcaptcha::MCaptcha] and adds it to [Master][libmcaptcha::Defense]
</span><span class="kw">pub async fn </span>init_mcaptcha(data: <span class="kw-2">&amp;</span>AppData, key: <span class="kw-2">&amp;</span>str) -&gt; ServiceResult&lt;()&gt; {
<span class="macro">println!</span>(<span class="string">&quot;Initializing captcha&quot;</span>);
<span class="macro">println!</span>(<span class="string">"Initializing captcha"</span>);
<span class="comment">// get levels
</span><span class="kw">let </span>levels = data.db.get_captcha_levels(<span class="prelude-val">None</span>, key).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>duration = data.db.get_captcha_cooldown(key).<span class="kw">await</span><span class="question-mark">?</span>;
@@ -376,12 +377,12 @@
}
<span class="kw">let </span>defense = defense.build()<span class="question-mark">?</span>;
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, defense);
<span class="macro">println!</span>(<span class="string">"{:?}"</span>, defense);
<span class="comment">// create captcha
</span><span class="kw">let </span>mcaptcha = MCaptchaBuilder::default()
.defense(defense)
<span class="comment">// leaky bucket algorithm&#39;s emission interval
<span class="comment">// leaky bucket algorithm's emission interval
</span>.duration(duration <span class="kw">as </span>u64)
<span class="comment">// .cache(cache)
</span>.build()
@@ -422,9 +423,9 @@
<span class="kw">use crate</span>::<span class="kw-2">*</span>;
<span class="kw">use </span>actix_web::test;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;powusrworks&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testingpas&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;randomuser@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"powusrworks"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"testingpas"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"randomuser@a.com"</span>;
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
@@ -441,7 +442,7 @@
<span class="comment">// update and check changes
</span><span class="kw">let </span>url = V1_API_ROUTES.pow.get_config;
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, <span class="kw-2">&amp;</span>url);
<span class="macro">println!</span>(<span class="string">"{}"</span>, <span class="kw-2">&amp;</span>url);
<span class="kw">let </span>get_config_resp = test::call_service(
<span class="kw-2">&amp;</span>app,
<span class="macro">post_request!</span>(<span class="kw-2">&amp;</span>get_config_payload, V1_API_ROUTES.pow.get_config)
@@ -478,9 +479,9 @@
<span class="kw">use </span><span class="kw">crate</span>::api::v1::mcaptcha::create::CreateCaptcha;
<span class="kw">use </span><span class="kw">crate</span>::api::v1::mcaptcha::create::MCaptchaDetails;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;powusrworks2&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testingpas&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;randomuser2@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"powusrworks2"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"testingpas"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"randomuser2@a.com"</span>;
<span class="kw">pub const </span>L1: Level = Level {
difficulty_factor: <span class="number">10</span>,
visitor_threshold: <span class="number">10</span>,
@@ -507,7 +508,7 @@
<span class="kw">let </span>create_captcha = CreateCaptcha {
levels: levels.into(),
duration: <span class="number">30</span>,
description: <span class="string">&quot;dummy&quot;</span>.into(),
description: <span class="string">"dummy"</span>.into(),
publish_benchmarks: <span class="bool-val">true</span>,
};
@@ -547,7 +548,7 @@
<span class="kw">let </span>config: PoWConfig = test::read_body_json(get_config_resp).<span class="kw">await</span>;
<span class="macro">println!</span>(
<span class="string">&quot;[{count}] received difficulty_factor: {} prev difficulty_factor {}&quot;</span>,
<span class="string">"[{count}] received difficulty_factor: {} prev difficulty_factor {}"</span>,
config.difficulty_factor, prev
);
<span class="kw">if </span>count == levels.len() - <span class="number">1 </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/api/v1/pow/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/api/v1/pow/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,7 +99,7 @@
<span class="kw">pub fn </span>services(cfg: <span class="kw-2">&amp;mut </span>web::ServiceConfig) {
<span class="kw">let </span>cors = actix_cors::Cors::default()
.allow_any_origin()
.allowed_methods(<span class="macro">vec!</span>[<span class="string">&quot;POST&quot;</span>, <span class="string">&quot;GET&quot;</span>])
.allowed_methods(<span class="macro">vec!</span>[<span class="string">"POST"</span>, <span class="string">"GET"</span>])
.allow_any_header()
.max_age(<span class="number">3600</span>)
.send_wildcard();
@@ -115,10 +116,10 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>PoW {
<span class="kw">pub </span>get_config: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>verify_pow: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>validate_captcha_token: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>scope: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>get_config: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>verify_pow: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>validate_captcha_token: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>scope: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="macro">macro_rules! </span>rm_scope {
@@ -138,12 +139,12 @@
<span class="comment">// date: 2021-11-29 16:31
// commit: 6eb75d7
// route 404s when scope contained trailing slash
//let scope = &quot;/api/v1/pow/&quot;;
</span><span class="kw">let </span>scope = <span class="string">&quot;/api/v1/pow&quot;</span>;
//let scope = "/api/v1/pow/";
</span><span class="kw">let </span>scope = <span class="string">"/api/v1/pow"</span>;
PoW {
get_config: <span class="string">&quot;/api/v1/pow/config&quot;</span>,
verify_pow: <span class="string">&quot;/api/v1/pow/verify&quot;</span>,
validate_captcha_token: <span class="string">&quot;/api/v1/pow/siteverify&quot;</span>,
get_config: <span class="string">"/api/v1/pow/config"</span>,
verify_pow: <span class="string">"/api/v1/pow/verify"</span>,
validate_captcha_token: <span class="string">"/api/v1/pow/siteverify"</span>,
scope,
}
}
@@ -161,9 +162,9 @@
<span class="attr">#[test]
</span><span class="kw">fn </span>scope_pow_works() {
<span class="kw">let </span>pow = PoW::new();
<span class="macro">assert_eq!</span>(pow.get_config(), <span class="string">&quot;/config&quot;</span>);
<span class="macro">assert_eq!</span>(pow.verify_pow(), <span class="string">&quot;/verify&quot;</span>);
<span class="macro">assert_eq!</span>(pow.validate_captcha_token(), <span class="string">&quot;/siteverify&quot;</span>);
<span class="macro">assert_eq!</span>(pow.get_config(), <span class="string">"/config"</span>);
<span class="macro">assert_eq!</span>(pow.verify_pow(), <span class="string">"/verify"</span>);
<span class="macro">assert_eq!</span>(pow.validate_captcha_token(), <span class="string">"/siteverify"</span>);
}
}
</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/api/v1/pow/verify_pow.rs`."><title>verify_pow.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/api/v1/pow/verify_pow.rs`."><title>verify_pow.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>
@@ -306,7 +307,7 @@
</span><span class="doccomment">/// route handler that verifies PoW and issues a solution token
/// if verification is successful
</span><span class="attr">#[my_codegen::post(path = <span class="string">&quot;V1_API_ROUTES.pow.verify_pow()&quot;</span>)]
</span><span class="attr">#[my_codegen::post(path = <span class="string">"V1_API_ROUTES.pow.verify_pow()"</span>)]
</span><span class="kw">pub async fn </span>verify_pow(
req: HttpRequest,
payload: web::Json&lt;ApiWork&gt;,
@@ -319,7 +320,7 @@
//
// ref: https://docs.rs/actix-web/latest/actix_web/struct.HttpRequest.html#method.peer_addr
</span><span class="attr">#[cfg(test)]
</span><span class="kw">let </span>ip = <span class="string">&quot;127.0.1.1&quot;</span>.into();
</span><span class="kw">let </span>ip = <span class="string">"127.0.1.1"</span>.into();
<span class="kw">let </span>key = payload.key.clone();
<span class="kw">let </span>payload = payload.into_inner();
@@ -379,9 +380,9 @@
}
<span class="kw">pub async fn </span>verify_analytics_pow_works(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;powanalyticsuser&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testingpas&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;powanalyticsuser@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"powanalyticsuser"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"testingpas"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"powanalyticsuser@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>;
@@ -419,7 +420,7 @@
nonce: work.nonce,
key: token_key.key.clone(),
time: <span class="prelude-val">Some</span>(<span class="number">100</span>),
worker_type: <span class="prelude-val">Some</span>(<span class="string">&quot;wasm&quot;</span>.into()),
worker_type: <span class="prelude-val">Some</span>(<span class="string">"wasm"</span>.into()),
};
<span class="kw">let </span>pow_verify_resp = test::call_service(
@@ -442,9 +443,9 @@
}
<span class="kw">pub async fn </span>verify_pow_works(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;powverifyusr&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testingpas&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;verifyuser@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"powverifyusr"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"testingpas"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"verifyuser@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>;
@@ -503,7 +504,7 @@
.<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(string_not_found.status(), StatusCode::BAD_REQUEST);
<span class="kw">let </span>err: ErrorToResponse = test::read_body_json(string_not_found).<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(err.error, <span class="string">&quot;Challenge: not found&quot;</span>);
<span class="macro">assert_eq!</span>(err.error, <span class="string">"Challenge: not found"</span>);
<span class="comment">// let pow_config_resp = test::call_service(
// &amp;app,
@@ -511,7 +512,7 @@
// )
// .await;
// assert_eq!(pow_config_resp.status(), StatusCode::OK);
// I&#39;m not checking for errors because changing work.result triggered
// I'm not checking for errors because changing work.result triggered
// InssuficientDifficulty, which is possible because libmcaptcha calculates
// difficulty with the submitted result. Besides, this endpoint is merely
// propagating errors from libmcaptcha and libmcaptcha has tests covering the

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/api/v1/pow/verify_token.rs`."><title>verify_token.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/api/v1/pow/verify_token.rs`."><title>verify_token.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>
@@ -234,7 +235,7 @@
<span class="comment">// API keys are mcaptcha actor names
</span><span class="doccomment">/// route handler that validates a PoW solution token
</span><span class="attr">#[my_codegen::post(path = <span class="string">&quot;V1_API_ROUTES.pow.validate_captcha_token()&quot;</span>)]
</span><span class="attr">#[my_codegen::post(path = <span class="string">"V1_API_ROUTES.pow.validate_captcha_token()"</span>)]
</span><span class="kw">pub async fn </span>validate_captcha_token(
payload: web::Json&lt;VerifyCaptchaResultPayload&gt;,
data: AppData,
@@ -248,7 +249,7 @@
<span class="kw">let </span>res = data.captcha.validate_verification_tokens(payload).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">let </span>resp = CaptchaValidateResp { valid: res };
data.stats.record_confirm(<span class="kw-2">&amp;</span>data, <span class="kw-2">&amp;</span>key).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="comment">//println!(&quot;{:?}&quot;, &amp;payload);
<span class="comment">//println!("{:?}", &amp;payload);
</span><span class="prelude-val">Ok</span>(HttpResponse::Ok().json(resp))
}
@@ -278,13 +279,13 @@
}
<span class="kw">pub async fn </span>validate_captcha_token_works(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;enterprisetken&quot;</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;testingpas&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;verifyuser@enter.com&quot;</span>;
<span class="kw">const </span>VERIFY_CAPTCHA_URL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;/api/v1/pow/verify&quot;</span>;
<span class="kw">const </span>GET_URL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;/api/v1/pow/config&quot;</span>;
<span class="kw">const </span>VERIFY_TOKEN_URL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;/api/v1/pow/siteverify&quot;</span>;
<span class="comment">// const UPDATE_URL: &amp;str = &quot;/api/v1/mcaptcha/domain/token/duration/update&quot;;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"enterprisetken"</span>;
<span class="kw">const </span>PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"testingpas"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"verifyuser@enter.com"</span>;
<span class="kw">const </span>VERIFY_CAPTCHA_URL: <span class="kw-2">&amp;</span>str = <span class="string">"/api/v1/pow/verify"</span>;
<span class="kw">const </span>GET_URL: <span class="kw-2">&amp;</span>str = <span class="string">"/api/v1/pow/config"</span>;
<span class="kw">const </span>VERIFY_TOKEN_URL: <span class="kw-2">&amp;</span>str = <span class="string">"/api/v1/pow/siteverify"</span>;
<span class="comment">// const UPDATE_URL: &amp;str = "/api/v1/mcaptcha/domain/token/duration/update";
</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/api/v1/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/api/v1/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>

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/api/v1/stats.rs`."><title>stats.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/api/v1/stats.rs`."><title>stats.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>
@@ -270,8 +271,8 @@
<span class="attr">#[derive(Clone, Debug, Deserialize, Builder, Serialize)]
</span><span class="kw">pub struct </span>BuildDetails {
<span class="kw">pub </span>version: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>git_commit_hash: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>version: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>git_commit_hash: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">pub mod </span>routes {
@@ -279,13 +280,13 @@
<span class="attr">#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
</span><span class="kw">pub struct </span>Stats {
<span class="kw">pub </span>percentile_benches: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>percentile_benches: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Stats {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
percentile_benches: <span class="string">&quot;/api/v1/stats/analytics/percentile&quot;</span>,
percentile_benches: <span class="string">"/api/v1/stats/analytics/percentile"</span>,
}
}
}
@@ -355,7 +356,7 @@
}
<span class="doccomment">/// Get difficulty factor with max time limit for percentile of stats
</span><span class="attr">#[my_codegen::post(path = <span class="string">&quot;crate::V1_API_ROUTES.stats.percentile_benches&quot;</span>)]
</span><span class="attr">#[my_codegen::post(path = <span class="string">"crate::V1_API_ROUTES.stats.percentile_benches"</span>)]
</span><span class="kw">async fn </span>percentile_benches(
data: AppData,
payload: web::Json&lt;PercentileReq&gt;,
@@ -403,12 +404,12 @@
<span class="kw">async fn </span>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;benchstatsuesr&quot;</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;benchstatsuesr@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">"benchstatsuesr"</span>;
<span class="kw">const </span>EMAIL: <span class="kw-2">&amp;</span>str = <span class="string">"benchstatsuesr@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;
@@ -446,11 +447,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();
}

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/api/v1/survey.rs`."><title>survey.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/api/v1/survey.rs`."><title>survey.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>
@@ -283,22 +284,22 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Survey {
<span class="kw">pub </span>download: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>secret: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>download: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>secret: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Survey {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
download: <span class="string">&quot;/api/v1/survey/takeout/{survey_id}/get&quot;</span>,
secret: <span class="string">&quot;/api/v1/survey/secret&quot;</span>,
download: <span class="string">"/api/v1/survey/takeout/{survey_id}/get"</span>,
secret: <span class="string">"/api/v1/survey/secret"</span>,
}
}
<span class="kw">pub fn </span>get_download_route(<span class="kw-2">&amp;</span><span class="self">self</span>, survey_id: <span class="kw-2">&amp;</span>str, page: usize) -&gt; String {
<span class="macro">format!</span>(
<span class="string">&quot;{}?page={}&quot;</span>,
<span class="self">self</span>.download.replace(<span class="string">&quot;{survey_id}&quot;</span>, survey_id),
<span class="string">"{}?page={}"</span>,
<span class="self">self</span>.download.replace(<span class="string">"{survey_id}"</span>, survey_id),
page
)
}
@@ -311,7 +312,7 @@
}
<span class="doccomment">/// emits build details of the bninary
</span><span class="attr">#[my_codegen::get(path = <span class="string">&quot;crate::V1_API_ROUTES.survey.download&quot;</span>)]
</span><span class="attr">#[my_codegen::get(path = <span class="string">"crate::V1_API_ROUTES.survey.download"</span>)]
</span><span class="kw">async fn </span>download(
data: AppData,
page: web::Query&lt;Page&gt;,
@@ -339,7 +340,7 @@
}
<span class="doccomment">/// mCaptcha/survey upload secret route
</span><span class="attr">#[my_codegen::post(path = <span class="string">&quot;crate::V1_API_ROUTES.survey.secret&quot;</span>)]
</span><span class="attr">#[my_codegen::post(path = <span class="string">"crate::V1_API_ROUTES.survey.secret"</span>)]
</span><span class="kw">async fn </span>secret(
data: AppData,
payload: web::Json&lt;SurveySecretUpload&gt;,
@@ -382,7 +383,7 @@
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data;
<span class="kw">let </span>app = <span class="macro">get_app!</span>(data).<span class="kw">await</span>;
<span class="kw">let </span>survey_instance_url = <span class="string">&quot;http://survey_registration_works.survey.example.org&quot;</span>;
<span class="kw">let </span>survey_instance_url = <span class="string">"http://survey_registration_works.survey.example.org"</span>;
<span class="kw">let </span>key = get_random(<span class="number">20</span>);
@@ -427,9 +428,9 @@
}
<span class="kw">pub async fn </span>survey_works(data: ArcData) {
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">&quot;survetuseranalytics&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;survetuseranalytics@a.com&quot;</span>;
<span class="kw">const </span>NAME: <span class="kw-2">&amp;</span>str = <span class="string">"survetuseranalytics"</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">"survetuseranalytics@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>;
@@ -464,18 +465,18 @@
</span>.unwrap();
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..<span class="number">60 </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: <span class="number">0</span>,
difficulty_factor: <span class="number">0</span>,
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();
}
<span class="kw">for </span>p <span class="kw">in </span><span class="number">1</span>..<span class="number">3 </span>{
<span class="kw">let </span>download_rotue = V1_API_ROUTES.survey.get_download_route(<span class="kw-2">&amp;</span>psuedo_id, p);
<span class="macro">println!</span>(<span class="string">&quot;page={p}, download={download_rotue}&quot;</span>);
<span class="macro">println!</span>(<span class="string">"page={p}, download={download_rotue}"</span>);
<span class="kw">let </span>download_req = 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/data.rs`."><title>data.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/data.rs`."><title>data.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>
@@ -462,9 +463,9 @@
<span class="attr">#[allow(unused_variables)]
</span><span class="kw">let </span>init = thread::spawn(<span class="kw">move </span>|| {
<span class="macro">log::info!</span>(<span class="string">&quot;Initializing credential manager&quot;</span>);
<span class="macro">log::info!</span>(<span class="string">"Initializing credential manager"</span>);
c.init();
<span class="macro">log::info!</span>(<span class="string">&quot;Initialized credential manager&quot;</span>);
<span class="macro">log::info!</span>(<span class="string">"Initialized credential manager"</span>);
});
<span class="kw">let </span>db = <span class="kw">match </span>s.database.database_type {
@@ -497,7 +498,7 @@
<span class="kw">fn </span>get_mailer(s: <span class="kw-2">&amp;</span>Settings) -&gt; <span class="prelude-ty">Option</span>&lt;Mailer&gt; {
<span class="kw">if let </span><span class="prelude-val">Some</span>(smtp) = s.smtp.as_ref() {
<span class="kw">let </span>creds =
Credentials::new(smtp.username.to_string(), smtp.password.to_string()); <span class="comment">// &quot;smtp_username&quot;.to_string(), &quot;smtp_password&quot;.to_string());
Credentials::new(smtp.username.to_string(), smtp.password.to_string()); <span class="comment">// "smtp_username".to_string(), "smtp_password".to_string());
</span><span class="kw">let </span>mailer: Mailer =
AsyncSmtpTransport::&lt;Tokio1Executor&gt;::builder_dangerous(<span class="kw-2">&amp;</span>smtp.url)
@@ -510,7 +511,7 @@
])
.build();
<span class="comment">// let mailer: Mailer = AsyncSmtpTransport::&lt;Tokio1Executor&gt;::relay(&amp;smtp.url) //&quot;smtp.gmail.com&quot;)
<span class="comment">// let mailer: Mailer = AsyncSmtpTransport::&lt;Tokio1Executor&gt;::relay(&amp;smtp.url) //"smtp.gmail.com")
// .unwrap()
// .credentials(creds)
// .build();

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/date.rs`."><title>date.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/date.rs`."><title>date.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>
@@ -122,9 +123,9 @@
}
<span class="kw">impl </span>Debug <span class="kw">for </span>Date {
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>std::fmt::Formatter&lt;<span class="lifetime">&#39;_</span>&gt;) -&gt; std::fmt::Result {
f.debug_struct(<span class="string">&quot;Date&quot;</span>)
.field(<span class="string">&quot;time&quot;</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.print_date())
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>std::fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; std::fmt::Result {
f.debug_struct(<span class="string">"Date"</span>)
.field(<span class="string">"time"</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.print_date())
.finish()
}
}
@@ -142,15 +143,15 @@
<span class="kw">let </span>difference = now - timestamp;
<span class="kw">if </span>difference &gt;= <span class="number">3 </span>* WEEK {
<span class="macro">format!</span>(<span class="string">&quot;{}{}{}&quot;</span>, date.year(), date.month(), date.date())
<span class="macro">format!</span>(<span class="string">"{}{}{}"</span>, date.year(), date.month(), date.date())
} <span class="kw">else if </span>(DAY..(<span class="number">3 </span>* WEEK)).contains(<span class="kw-2">&amp;</span>difference) {
<span class="macro">format!</span>(<span class="string">&quot;{} days ago&quot;</span>, date.hour())
<span class="macro">format!</span>(<span class="string">"{} days ago"</span>, date.hour())
} <span class="kw">else if </span>(HOUR..DAY).contains(<span class="kw-2">&amp;</span>difference) {
<span class="macro">format!</span>(<span class="string">&quot;{} hours ago&quot;</span>, date.hour())
<span class="macro">format!</span>(<span class="string">"{} hours ago"</span>, date.hour())
} <span class="kw">else if </span>(MINUTE..HOUR).contains(<span class="kw-2">&amp;</span>difference) {
<span class="macro">format!</span>(<span class="string">&quot;{} minutes ago&quot;</span>, date.minute())
<span class="macro">format!</span>(<span class="string">"{} minutes ago"</span>, date.minute())
} <span class="kw">else </span>{
<span class="macro">format!</span>(<span class="string">&quot;{} seconds ago&quot;</span>, date.second())
<span class="macro">format!</span>(<span class="string">"{} seconds ago"</span>, date.second())
}
}
@@ -162,7 +163,7 @@
<span class="doccomment">/// print date
</span><span class="kw">pub fn </span>date(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; String {
<span class="macro">format!</span>(
<span class="string">&quot;{}{}{}&quot;</span>,
<span class="string">"{}{}{}"</span>,
<span class="self">self</span>.time.year(),
<span class="self">self</span>.time.month(),
<span class="self">self</span>.time.date()
@@ -187,32 +188,32 @@
};
<span class="kw">let </span>timestamp = n.time.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.time = 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.time = 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.time = 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.time = 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.time = 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.time = 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.time = 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>, n.time.year(), n.time.month(), n.time.date());
<span class="kw">let </span>date = <span class="macro">format!</span>(<span class="string">"{}{}{}"</span>, n.time.year(), n.time.month(), n.time.date());
<span class="macro">assert!</span>(n.print_date().contains(<span class="kw-2">&amp;</span>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/db.rs`."><title>db.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/db.rs`."><title>db.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>

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/demo.rs`."><title>demo.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/demo.rs`."><title>demo.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>
@@ -214,9 +215,9 @@
<span class="kw">use </span>errors::<span class="kw-2">*</span>;
<span class="doccomment">/// Demo username
</span><span class="kw">pub const </span>DEMO_USER: <span class="kw-2">&amp;</span>str = <span class="string">&quot;aaronsw&quot;</span>;
</span><span class="kw">pub const </span>DEMO_USER: <span class="kw-2">&amp;</span>str = <span class="string">"aaronsw"</span>;
<span class="doccomment">/// Demo password
</span><span class="kw">pub const </span>DEMO_PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">&quot;password&quot;</span>;
</span><span class="kw">pub const </span>DEMO_PASSWORD: <span class="kw-2">&amp;</span>str = <span class="string">"password"</span>;
<span class="kw">pub struct </span>DemoUser {
tx: Sender&lt;()&gt;,
@@ -253,7 +254,7 @@
email: <span class="prelude-val">None</span>,
};
<span class="macro">log::info!</span>(<span class="string">&quot;Registering demo user&quot;</span>);
<span class="macro">log::info!</span>(<span class="string">"Registering demo user"</span>);
<span class="kw">match </span>register_runner(<span class="kw-2">&amp;</span>register_payload, data).<span class="kw">await </span>{
<span class="prelude-val">Err</span>(ServiceError::UsernameTaken) | <span class="prelude-val">Ok</span>(<span class="kw">_</span>) =&gt; <span class="prelude-val">Ok</span>(()),
<span class="prelude-val">Err</span>(e) =&gt; <span class="prelude-val">Err</span>(e),
@@ -264,7 +265,7 @@
}
<span class="kw">async fn </span>delete_demo_user(data: <span class="kw-2">&amp;</span>AppData) -&gt; ServiceResult&lt;()&gt; {
<span class="macro">log::info!</span>(<span class="string">&quot;Deleting demo user&quot;</span>);
<span class="macro">log::info!</span>(<span class="string">"Deleting demo user"</span>);
delete_user(DEMO_USER, data).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(())
}
@@ -300,11 +301,11 @@
}
<span class="kw">if let </span><span class="prelude-val">Err</span>(e) = <span class="self">Self</span>::delete_demo_user(<span class="kw-2">&amp;</span>data).<span class="kw">await </span>{
<span class="macro">log::error!</span>(<span class="string">&quot;Error while deleting demo user: {:?}&quot;</span>, e);
<span class="macro">log::error!</span>(<span class="string">"Error while deleting demo user: {:?}"</span>, e);
}
<span class="kw">if let </span><span class="prelude-val">Err</span>(e) = <span class="self">Self</span>::register_demo_user(<span class="kw-2">&amp;</span>data).<span class="kw">await </span>{
<span class="macro">log::error!</span>(<span class="string">&quot;Error while registering demo user: {:?}&quot;</span>, e);
<span class="macro">log::error!</span>(<span class="string">"Error while registering demo user: {:?}"</span>, e);
}
}
};

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/docs.rs`."><title>docs.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/docs.rs`."><title>docs.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>
@@ -140,17 +141,17 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Docs {
<span class="kw">pub </span>home: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>spec: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>assets: <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>spec: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
<span class="kw">pub </span>assets: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Docs {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
Docs {
home: <span class="string">&quot;/docs/&quot;</span>,
spec: <span class="string">&quot;/docs/openapi.yaml&quot;</span>,
assets: <span class="string">&quot;/docs/{_:.*}&quot;</span>,
home: <span class="string">"/docs/"</span>,
spec: <span class="string">"/docs/openapi.yaml"</span>,
assets: <span class="string">"/docs/{_:.*}"</span>,
}
}
}
@@ -161,7 +162,7 @@
}
<span class="attr">#[derive(RustEmbed)]
#[folder = <span class="string">&quot;static/openapi/&quot;</span>]
#[folder = <span class="string">"static/openapi/"</span>]
</span><span class="kw">struct </span>Asset;
<span class="kw">pub fn </span>handle_embedded_file(path: <span class="kw-2">&amp;</span>str) -&gt; HttpResponse {
@@ -175,32 +176,32 @@
HttpResponse::Ok()
.insert_header(header::CacheControl(<span class="macro">vec!</span>[
header::CacheDirective::Public,
header::CacheDirective::Extension(<span class="string">&quot;immutable&quot;</span>.into(), <span class="prelude-val">None</span>),
header::CacheDirective::Extension(<span class="string">"immutable"</span>.into(), <span class="prelude-val">None</span>),
header::CacheDirective::MaxAge(CACHE_AGE),
]))
.content_type(from_path(path).first_or_octet_stream().as_ref())
.body(body)
}
<span class="prelude-val">None </span>=&gt; HttpResponse::NotFound().body(<span class="string">&quot;404 Not Found&quot;</span>),
<span class="prelude-val">None </span>=&gt; HttpResponse::NotFound().body(<span class="string">"404 Not Found"</span>),
}
}
<span class="attr">#[my_codegen::get(path = <span class="string">&quot;DOCS.assets&quot;</span>)]
<span class="attr">#[my_codegen::get(path = <span class="string">"DOCS.assets"</span>)]
</span><span class="kw">async fn </span>dist(path: web::Path&lt;String&gt;) -&gt; <span class="kw">impl </span>Responder {
handle_embedded_file(<span class="kw-2">&amp;</span>path)
}
<span class="kw">const </span>OPEN_API_SPEC: <span class="kw-2">&amp;</span>str = <span class="macro">include_str!</span>(<span class="string">&quot;../docs/openapi/dist/openapi.yaml&quot;</span>);
<span class="kw">const </span>OPEN_API_SPEC: <span class="kw-2">&amp;</span>str = <span class="macro">include_str!</span>(<span class="string">"../docs/openapi/dist/openapi.yaml"</span>);
<span class="attr">#[my_codegen::get(path = <span class="string">&quot;DOCS.spec&quot;</span>)]
<span class="attr">#[my_codegen::get(path = <span class="string">"DOCS.spec"</span>)]
</span><span class="kw">async fn </span>spec() -&gt; HttpResponse {
HttpResponse::Ok()
.content_type(<span class="string">&quot;text/yaml&quot;</span>)
.content_type(<span class="string">"text/yaml"</span>)
.body(OPEN_API_SPEC)
}
<span class="attr">#[my_codegen::get(path = <span class="string">&quot;&amp;DOCS.home[0..DOCS.home.len() -1]&quot;</span>)]
<span class="attr">#[my_codegen::get(path = <span class="string">"&amp;DOCS.home[0..DOCS.home.len() -1]"</span>)]
</span><span class="kw">async fn </span>index() -&gt; HttpResponse {
handle_embedded_file(<span class="string">&quot;index.html&quot;</span>)
handle_embedded_file(<span class="string">"index.html"</span>)
}
<span class="attr">#[cfg(test)]
@@ -213,7 +214,7 @@
<span class="attr">#[actix_rt::test]
</span><span class="kw">async fn </span>docs_works() {
<span class="kw">const </span>FILE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;favicon-32x32.png&quot;</span>;
<span class="kw">const </span>FILE: <span class="kw-2">&amp;</span>str = <span class="string">"favicon-32x32.png"</span>;
<span class="kw">let </span>app = test::init_service(
App::new()
@@ -238,7 +239,7 @@
.<span class="kw">await</span>;
<span class="macro">assert_eq!</span>(resp.status(), StatusCode::OK);
<span class="kw">let </span>uri = <span class="macro">format!</span>(<span class="string">&quot;{}{}&quot;</span>, DOCS.home, FILE);
<span class="kw">let </span>uri = <span class="macro">format!</span>(<span class="string">"{}{}"</span>, DOCS.home, FILE);
<span class="kw">let </span>resp =
test::call_service(<span class="kw-2">&amp;</span>app, test::TestRequest::get().uri(<span class="kw-2">&amp;</span>uri).to_request())

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/easy.rs`."><title>easy.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/easy.rs`."><title>easy.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>
@@ -252,7 +253,7 @@
</span>.err()
{
<span class="macro">log::error!</span>(
<span class="string">&quot;Tried to update easy captcha configurations in background {:?}&quot;</span>,
<span class="string">"Tried to update easy captcha configurations in background {:?}"</span>,
err
);
}

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/email/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/email/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>

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/email/verification.rs`."><title>verification.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/email/verification.rs`."><title>verification.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>
@@ -142,16 +143,16 @@
<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>::Data;
<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="attr">#[derive(Clone, TemplateOnce)]
#[template(path = <span class="string">&quot;email/verification/index.html&quot;</span>)]
</span><span class="kw">struct </span>IndexPage&lt;<span class="lifetime">&#39;a</span>&gt; {
verification_link: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str,
#[template(path = <span class="string">"email/verification/index.html"</span>)]
</span><span class="kw">struct </span>IndexPage&lt;<span class="lifetime">'a</span>&gt; {
verification_link: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str,
}
<span class="kw">impl</span>&lt;<span class="lifetime">&#39;a</span>&gt; IndexPage&lt;<span class="lifetime">&#39;a</span>&gt; {
<span class="kw">fn </span>new(verification_link: <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; IndexPage&lt;<span class="lifetime">'a</span>&gt; {
<span class="kw">fn </span>new(verification_link: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str) -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{ verification_link }
}
}
@@ -162,24 +163,24 @@
verification_link: <span class="kw-2">&amp;</span>str,
) -&gt; ServiceResult&lt;()&gt; {
<span class="kw">if let </span><span class="prelude-val">Some</span>(smtp) = data.settings.smtp.as_ref() {
<span class="kw">let </span>from = <span class="macro">format!</span>(<span class="string">&quot;mCaptcha Admin &lt;{}&gt;&quot;</span>, smtp.from);
<span class="kw">let </span>reply_to = <span class="macro">format!</span>(<span class="string">&quot;mCaptcha Admin &lt;{}&gt;&quot;</span>, smtp.reply);
<span class="kw">const </span>SUBJECT: <span class="kw-2">&amp;</span>str = <span class="string">&quot;[mCaptcha] Please verify your email&quot;</span>;
<span class="kw">let </span>from = <span class="macro">format!</span>(<span class="string">"mCaptcha Admin &lt;{}&gt;"</span>, smtp.from);
<span class="kw">let </span>reply_to = <span class="macro">format!</span>(<span class="string">"mCaptcha Admin &lt;{}&gt;"</span>, smtp.reply);
<span class="kw">const </span>SUBJECT: <span class="kw-2">&amp;</span>str = <span class="string">"[mCaptcha] Please verify your email"</span>;
<span class="kw">let </span>plain_text = <span class="macro">format!</span>(
<span class="string">&quot;
<span class="string">"
Welcome to mCaptcha!
Please verify your email address to continue.
VERIFICATION LINK: {}
Please ignore this email if you weren&#39;t expecting it.
Please ignore this email if you weren't expecting it.
With best regards,
Admin
instance: {}
project website: {}&quot;</span>,
project website: {}"</span>,
verification_link,
<span class="kw-2">&amp;</span>data.settings.server.domain,
<span class="kw">crate</span>::PKG_HOMEPAGE
@@ -231,8 +232,8 @@ project website: {}&quot;</span>,
}
<span class="kw">async fn </span>email_verification_works(data: <span class="kw">crate</span>::ArcData) {
<span class="kw">const </span>TO_ADDR: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Hello &lt;realaravinth@localhost&gt;&quot;</span>;
<span class="kw">const </span>VERIFICATION_LINK: <span class="kw-2">&amp;</span>str = <span class="string">&quot;https://localhost&quot;</span>;
<span class="kw">const </span>TO_ADDR: <span class="kw-2">&amp;</span>str = <span class="string">"Hello &lt;realaravinth@localhost&gt;"</span>;
<span class="kw">const </span>VERIFICATION_LINK: <span class="kw-2">&amp;</span>str = <span class="string">"https://localhost"</span>;
<span class="kw">let </span>settings = <span class="kw-2">&amp;</span>data.settings;
verification(<span class="kw-2">&amp;</span>data, TO_ADDR, VERIFICATION_LINK)
.<span class="kw">await
@@ -240,7 +241,7 @@ project website: {}&quot;</span>,
<span class="kw">let </span>client = Client::default();
<span class="kw">let </span><span class="kw-2">mut </span>resp = client
.get(<span class="string">&quot;http://localhost:1080/email&quot;</span>)
.get(<span class="string">"http://localhost:1080/email"</span>)
.send()
.<span class="kw">await
</span>.unwrap();
@@ -248,11 +249,11 @@ project website: {}&quot;</span>,
<span class="kw">let </span>data = <span class="kw-2">&amp;</span>data[<span class="number">0</span>];
<span class="kw">let </span>smtp = settings.smtp.as_ref().unwrap();
<span class="kw">let </span>from_addr = <span class="kw-2">&amp;</span>data[<span class="string">&quot;headers&quot;</span>][<span class="string">&quot;from&quot;</span>];
<span class="kw">let </span>from_addr = <span class="kw-2">&amp;</span>data[<span class="string">"headers"</span>][<span class="string">"from"</span>];
<span class="macro">assert!</span>(from_addr.to_string().contains(<span class="kw-2">&amp;</span>smtp.from));
<span class="kw">let </span>body = <span class="kw-2">&amp;</span>data[<span class="string">&quot;html&quot;</span>];
<span class="kw">let </span>body = <span class="kw-2">&amp;</span>data[<span class="string">"html"</span>];
<span class="macro">assert!</span>(body.to_string().contains(VERIFICATION_LINK));
}
}

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/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/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>
@@ -356,7 +357,7 @@
<span class="kw">impl </span>std::cmp::PartialEq <span class="kw">for </span>DBErrorWrapper {
<span class="kw">fn </span>eq(<span class="kw-2">&amp;</span><span class="self">self</span>, other: <span class="kw-2">&amp;</span><span class="self">Self</span>) -&gt; bool {
<span class="macro">format!</span>(<span class="string">&quot;{}&quot;</span>, <span class="self">self</span>.<span class="number">0</span>) == <span class="macro">format!</span>(<span class="string">&quot;{}&quot;</span>, other.<span class="number">0</span>)
<span class="macro">format!</span>(<span class="string">"{}"</span>, <span class="self">self</span>.<span class="number">0</span>) == <span class="macro">format!</span>(<span class="string">"{}"</span>, other.<span class="number">0</span>)
}
}
@@ -369,74 +370,74 @@
<span class="attr">#[derive(Debug, Display, PartialEq, Error)]
#[cfg(not(tarpaulin_include))]
</span><span class="kw">pub enum </span>ServiceError {
<span class="attr">#[display(fmt = <span class="string">&quot;internal server error&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"internal server error"</span>)]
</span>InternalServerError,
<span class="attr">#[display(
fmt = <span class="string">&quot;This server is is closed for registration. Contact admin if this is unexpecter&quot;
fmt = <span class="string">"This server is is closed for registration. Contact admin if this is unexpecter"
</span>)]
</span>ClosedForRegistration,
<span class="attr">#[display(fmt = <span class="string">&quot;The value you entered for email is not an email&quot;</span>)] </span><span class="comment">//405j
<span class="attr">#[display(fmt = <span class="string">"The value you entered for email is not an email"</span>)] </span><span class="comment">//405j
</span>NotAnEmail,
<span class="attr">#[display(fmt = <span class="string">&quot;The value you entered for URL is not a URL&quot;</span>)] </span><span class="comment">//405j
<span class="attr">#[display(fmt = <span class="string">"The value you entered for URL is not a URL"</span>)] </span><span class="comment">//405j
</span>NotAUrl,
<span class="attr">#[display(fmt = <span class="string">&quot;Wrong password&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"Wrong password"</span>)]
</span>WrongPassword,
<span class="attr">#[display(fmt = <span class="string">&quot;Username not found&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"Username not found"</span>)]
</span>UsernameNotFound,
<span class="attr">#[display(fmt = <span class="string">&quot;Account not found&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"Account not found"</span>)]
</span>AccountNotFound,
<span class="doccomment">/// when the value passed contains profainity
</span><span class="attr">#[display(fmt = <span class="string">&quot;Can&#39;t allow profanity in usernames&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"Can't allow profanity in usernames"</span>)]
</span>ProfainityError,
<span class="doccomment">/// when the value passed contains blacklisted words
/// see [blacklist](https://github.com/shuttlecraft/The-Big-Username-Blacklist)
</span><span class="attr">#[display(fmt = <span class="string">&quot;Username contains blacklisted words&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"Username contains blacklisted words"</span>)]
</span>BlacklistError,
<span class="doccomment">/// when the value passed contains characters not present
/// in [UsernameCaseMapped](https://tools.ietf.org/html/rfc8265#page-7)
/// profile
</span><span class="attr">#[display(fmt = <span class="string">&quot;username_case_mapped violation&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"username_case_mapped violation"</span>)]
</span>UsernameCaseMappedError,
<span class="attr">#[display(fmt = <span class="string">&quot;Passsword too short&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"Passsword too short"</span>)]
</span>PasswordTooShort,
<span class="attr">#[display(fmt = <span class="string">&quot;Username too long&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"Username too long"</span>)]
</span>PasswordTooLong,
<span class="attr">#[display(fmt = <span class="string">&quot;Passwords don&#39;t match&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"Passwords don't match"</span>)]
</span>PasswordsDontMatch,
<span class="doccomment">/// when the a username is already taken
</span><span class="attr">#[display(fmt = <span class="string">&quot;Username not available&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"Username not available"</span>)]
</span>UsernameTaken,
<span class="doccomment">/// email is already taken
</span><span class="attr">#[display(fmt = <span class="string">&quot;Email not available&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"Email not available"</span>)]
</span>EmailTaken,
<span class="doccomment">/// Unable to send email
</span><span class="attr">#[display(fmt = <span class="string">&quot;Unable to send email, contact admin&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"Unable to send email, contact admin"</span>)]
</span>UnableToSendEmail(SmtpErrorWrapper),
<span class="doccomment">/// token not found
</span><span class="attr">#[display(fmt = <span class="string">&quot;Token not found. Is token registered?&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"Token not found. Is token registered?"</span>)]
</span>TokenNotFound,
<span class="attr">#[display(fmt = <span class="string">&quot;{}&quot;</span>, _0)]
<span class="attr">#[display(fmt = <span class="string">"{}"</span>, _0)]
</span>CaptchaError(CaptchaError),
<span class="attr">#[display(fmt = <span class="string">&quot;{}&quot;</span>, _0)]
<span class="attr">#[display(fmt = <span class="string">"{}"</span>, _0)]
</span>DBError(DBErrorWrapper),
<span class="doccomment">/// captcha not found
</span><span class="attr">#[display(fmt = <span class="string">&quot;Captcha not found.&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"Captcha not found."</span>)]
</span>CaptchaNotFound,
<span class="doccomment">/// Traffic pattern not found
</span><span class="attr">#[display(fmt = <span class="string">&quot;Traffic pattern not found&quot;</span>)]
</span><span class="attr">#[display(fmt = <span class="string">"Traffic pattern not found"</span>)]
</span>TrafficPatternNotFound,
}
@@ -451,7 +452,7 @@
<span class="attr">#[cfg(not(tarpaulin_include))]
</span><span class="kw">fn </span>error_response(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; HttpResponse {
HttpResponseBuilder::new(<span class="self">self</span>.status_code())
.append_header((header::CONTENT_TYPE, <span class="string">&quot;application/json; charset=UTF-8&quot;</span>))
.append_header((header::CONTENT_TYPE, <span class="string">"application/json; charset=UTF-8"</span>))
.body(
serde_json::to_string(<span class="kw-2">&amp;</span>ErrorToResponse {
error: <span class="self">self</span>.to_string(),
@@ -484,7 +485,7 @@
ServiceError::TokenNotFound =&gt; StatusCode::NOT_FOUND,
ServiceError::CaptchaError(e) =&gt; {
<span class="macro">log::error!</span>(<span class="string">&quot;{}&quot;</span>, e);
<span class="macro">log::error!</span>(<span class="string">"{}"</span>, e);
<span class="kw">match </span>e {
CaptchaError::MailboxError =&gt; StatusCode::INTERNAL_SERVER_ERROR,
<span class="kw">_ </span>=&gt; StatusCode::BAD_REQUEST,
@@ -492,7 +493,7 @@
}
ServiceError::UnableToSendEmail(e) =&gt; {
<span class="macro">log::error!</span>(<span class="string">&quot;{}&quot;</span>, e.<span class="number">0</span>);
<span class="macro">log::error!</span>(<span class="string">"{}"</span>, e.<span class="number">0</span>);
StatusCode::INTERNAL_SERVER_ERROR
}
@@ -521,7 +522,7 @@
<span class="kw">impl </span>From&lt;DBError&gt; <span class="kw">for </span>ServiceError {
<span class="attr">#[cfg(not(tarpaulin_include))]
</span><span class="kw">fn </span>from(e: DBError) -&gt; ServiceError {
<span class="macro">println!</span>(<span class="string">&quot;from conversin: {}&quot;</span>, e);
<span class="macro">println!</span>(<span class="string">"from conversin: {}"</span>, e);
<span class="kw">match </span>e {
DBError::UsernameTaken =&gt; ServiceError::UsernameTaken,
DBError::SecretTaken =&gt; ServiceError::InternalServerError,
@@ -567,7 +568,7 @@
</span><span class="kw">impl </span>From&lt;RecvError&gt; <span class="kw">for </span>ServiceError {
<span class="attr">#[cfg(not(tarpaulin_include))]
</span><span class="kw">fn </span>from(e: RecvError) -&gt; <span class="self">Self </span>{
<span class="macro">log::error!</span>(<span class="string">&quot;{:?}&quot;</span>, e);
<span class="macro">log::error!</span>(<span class="string">"{:?}"</span>, e);
ServiceError::InternalServerError
}
}
@@ -576,7 +577,7 @@
</span><span class="kw">impl </span>From&lt;MailboxError&gt; <span class="kw">for </span>ServiceError {
<span class="attr">#[cfg(not(tarpaulin_include))]
</span><span class="kw">fn </span>from(e: MailboxError) -&gt; <span class="self">Self </span>{
<span class="macro">log::error!</span>(<span class="string">&quot;{:?}&quot;</span>, e);
<span class="macro">log::error!</span>(<span class="string">"{:?}"</span>, e);
ServiceError::InternalServerError
}
}
@@ -587,10 +588,10 @@
<span class="attr">#[derive(Debug, Display, PartialEq, Error)]
#[cfg(not(tarpaulin_include))]
</span><span class="kw">pub enum </span>PageError {
<span class="attr">#[display(fmt = <span class="string">&quot;Something weng wrong: Internal server error&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"Something weng wrong: Internal server error"</span>)]
</span>InternalServerError,
<span class="attr">#[display(fmt = <span class="string">&quot;{}&quot;</span>, _0)]
<span class="attr">#[display(fmt = <span class="string">"{}"</span>, _0)]
</span>ServiceError(ServiceError),
}

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/main.rs`."><title>main.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/main.rs`."><title>main.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>
@@ -275,40 +276,40 @@
<span class="macro">lazy_static! </span>{
<span class="kw">pub static </span><span class="kw-2">ref </span>SETTINGS: Settings = Settings::new().unwrap();
<span class="comment">// pub static ref S: String = env::var(&quot;S&quot;).unwrap();
<span class="comment">// pub static ref S: String = env::var("S").unwrap();
</span><span class="kw">pub static </span><span class="kw-2">ref </span>FILES: FileMap = FileMap::new();
<span class="kw">pub static </span><span class="kw-2">ref </span>JS: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str =
FILES.get(<span class="string">&quot;./static/cache/bundle/bundle.js&quot;</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>CSS: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str =
FILES.get(<span class="string">&quot;./static/cache/bundle/css/main.css&quot;</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>MOBILE_CSS: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str =
FILES.get(<span class="string">&quot;./static/cache/bundle/css/mobile.css&quot;</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>JS: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str =
FILES.get(<span class="string">"./static/cache/bundle/bundle.js"</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>CSS: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str =
FILES.get(<span class="string">"./static/cache/bundle/css/main.css"</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>MOBILE_CSS: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str =
FILES.get(<span class="string">"./static/cache/bundle/css/mobile.css"</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>VERIFICATIN_WIDGET_JS: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str =
FILES.get(<span class="string">&quot;./static/cache/bundle/verificationWidget.js&quot;</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>VERIFICATIN_WIDGET_CSS: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str =
FILES.get(<span class="string">&quot;./static/cache/bundle/css/widget.css&quot;</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>VERIFICATIN_WIDGET_JS: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str =
FILES.get(<span class="string">"./static/cache/bundle/verificationWidget.js"</span>).unwrap();
<span class="kw">pub static </span><span class="kw-2">ref </span>VERIFICATIN_WIDGET_CSS: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str =
FILES.get(<span class="string">"./static/cache/bundle/css/widget.css"</span>).unwrap();
<span class="doccomment">/// points to source files matching build commit
</span><span class="kw">pub static </span><span class="kw-2">ref </span>SOURCE_FILES_OF_INSTANCE: String = {
<span class="kw">let </span><span class="kw-2">mut </span>url = SETTINGS.source_code.clone();
<span class="kw">if </span>!url.ends_with(<span class="string">&#39;/&#39;</span>) {
url.push(<span class="string">&#39;/&#39;</span>);
<span class="kw">if </span>!url.ends_with(<span class="string">'/'</span>) {
url.push(<span class="string">'/'</span>);
}
<span class="kw">let </span><span class="kw-2">mut </span>base = url::Url::parse(<span class="kw-2">&amp;</span>url).unwrap();
base = base.join(<span class="string">&quot;tree/&quot;</span>).unwrap();
base = base.join(<span class="string">"tree/"</span>).unwrap();
base = base.join(GIT_COMMIT_HASH).unwrap();
base.into()
};
}
<span class="kw">pub const </span>COMPILED_DATE: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">&quot;COMPILED_DATE&quot;</span>);
<span class="kw">pub const </span>GIT_COMMIT_HASH: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">&quot;GIT_HASH&quot;</span>);
<span class="kw">pub const </span>VERSION: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">&quot;CARGO_PKG_VERSION&quot;</span>);
<span class="kw">pub const </span>PKG_NAME: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">&quot;CARGO_PKG_NAME&quot;</span>);
<span class="kw">pub const </span>PKG_DESCRIPTION: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">&quot;CARGO_PKG_DESCRIPTION&quot;</span>);
<span class="kw">pub const </span>PKG_HOMEPAGE: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">&quot;CARGO_PKG_HOMEPAGE&quot;</span>);
<span class="kw">pub const </span>COMPILED_DATE: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">"COMPILED_DATE"</span>);
<span class="kw">pub const </span>GIT_COMMIT_HASH: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">"GIT_HASH"</span>);
<span class="kw">pub const </span>VERSION: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">"CARGO_PKG_VERSION"</span>);
<span class="kw">pub const </span>PKG_NAME: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">"CARGO_PKG_NAME"</span>);
<span class="kw">pub const </span>PKG_DESCRIPTION: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">"CARGO_PKG_DESCRIPTION"</span>);
<span class="kw">pub const </span>PKG_HOMEPAGE: <span class="kw-2">&amp;</span>str = <span class="macro">env!</span>(<span class="string">"CARGO_PKG_HOMEPAGE"</span>);
<span class="kw">pub const </span>CACHE_AGE: u32 = <span class="number">604800</span>;
@@ -320,13 +321,13 @@
</span><span class="kw">async fn </span>main() -&gt; std::io::Result&lt;()&gt; {
<span class="kw">use </span>std::time::Duration;
<span class="kw">if </span>env::var(<span class="string">&quot;RUST_LOG&quot;</span>).is_err() {
env::set_var(<span class="string">&quot;RUST_LOG&quot;</span>, <span class="string">&quot;info&quot;</span>);
<span class="kw">if </span>env::var(<span class="string">"RUST_LOG"</span>).is_err() {
env::set_var(<span class="string">"RUST_LOG"</span>, <span class="string">"info"</span>);
}
pretty_env_logger::init();
<span class="macro">info!</span>(
<span class="string">&quot;{}: {}.\nFor more information, see: {}\nBuild info:\nVersion: {} commit: {}&quot;</span>,
<span class="string">"{}: {}.\nFor more information, see: {}\nBuild info:\nVersion: {} commit: {}"</span>,
PKG_NAME, PKG_DESCRIPTION, PKG_HOMEPAGE, VERSION, GIT_COMMIT_HASH
);
@@ -364,14 +365,14 @@
}
<span class="kw">let </span>ip = settings.server.get_ip();
<span class="macro">println!</span>(<span class="string">&quot;Starting server on: http://{ip}&quot;</span>);
<span class="macro">println!</span>(<span class="string">"Starting server on: http://{ip}"</span>);
HttpServer::new(<span class="kw">move </span>|| {
App::new()
.wrap(actix_middleware::Logger::default())
.wrap(
actix_middleware::DefaultHeaders::new()
.add((<span class="string">&quot;Permissions-Policy&quot;</span>, <span class="string">&quot;interest-cohort=()&quot;</span>)),
.add((<span class="string">"Permissions-Policy"</span>, <span class="string">"interest-cohort=()"</span>)),
)
.wrap(get_identity_service(<span class="kw-2">&amp;</span>settings))
.wrap(actix_middleware::Compress::default())
@@ -411,7 +412,7 @@
<span class="attr">#[cfg(not(tarpaulin_include))]
</span><span class="kw">pub fn </span>get_json_err() -&gt; JsonConfig {
JsonConfig::default().error_handler(|err, <span class="kw">_</span>| {
<span class="comment">//debug!(&quot;JSON deserialization error: {:?}&quot;, &amp;err);
<span class="comment">//debug!("JSON deserialization error: {:?}", &amp;err);
</span>InternalError::new(err, StatusCode::BAD_REQUEST).into()
})
}
@@ -423,7 +424,7 @@
<span class="kw">let </span>cookie_secret = <span class="kw-2">&amp;</span>settings.server.cookie_secret;
IdentityService::new(
CookieIdentityPolicy::new(cookie_secret.as_bytes())
.name(<span class="string">&quot;Authorization&quot;</span>)
.name(<span class="string">"Authorization"</span>)
<span class="comment">//TODO change cookie age
</span>.max_age_secs(<span class="number">216000</span>)
.domain(<span class="kw-2">&amp;</span>settings.server.domain)
@@ -438,7 +439,7 @@
<span class="macro">assert_eq!</span>(
<span class="kw-2">&amp;*</span><span class="kw">crate</span>::SOURCE_FILES_OF_INSTANCE,
<span class="kw-2">&amp;</span><span class="macro">format!</span>(
<span class="string">&quot;https://github.com/mCaptcha/mCaptcha/tree/{}&quot;</span>,
<span class="string">"https://github.com/mCaptcha/mCaptcha/tree/{}"</span>,
<span class="kw">crate</span>::GIT_COMMIT_HASH
)
);

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>

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/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/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>

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/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/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>
@@ -703,25 +704,25 @@
<span class="kw">impl </span>Server {
<span class="attr">#[cfg(not(tarpaulin_include))]
</span><span class="kw">pub fn </span>get_ip(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; String {
<span class="macro">format!</span>(<span class="string">&quot;{}:{}&quot;</span>, <span class="self">self</span>.ip, <span class="self">self</span>.port)
<span class="macro">format!</span>(<span class="string">"{}:{}"</span>, <span class="self">self</span>.ip, <span class="self">self</span>.port)
}
}
<span class="attr">#[derive(Deserialize, Serialize, Display, Eq, PartialEq, Clone, Debug)]
#[serde(rename_all = <span class="string">&quot;lowercase&quot;</span>)]
#[serde(rename_all = <span class="string">"lowercase"</span>)]
</span><span class="kw">pub enum </span>DBType {
<span class="attr">#[display(fmt = <span class="string">&quot;postgres&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"postgres"</span>)]
</span>Postgres,
<span class="attr">#[display(fmt = <span class="string">&quot;maria&quot;</span>)]
<span class="attr">#[display(fmt = <span class="string">"maria"</span>)]
</span>Maria,
}
<span class="kw">impl </span>DBType {
<span class="kw">fn </span>from_url(url: <span class="kw-2">&amp;</span>Url) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, ConfigError&gt; {
<span class="kw">match </span>url.scheme() {
<span class="string">&quot;mysql&quot; </span>=&gt; <span class="prelude-val">Ok</span>(<span class="self">Self</span>::Maria),
<span class="string">&quot;postgres&quot; </span>=&gt; <span class="prelude-val">Ok</span>(<span class="self">Self</span>::Postgres),
<span class="kw">_ </span>=&gt; <span class="prelude-val">Err</span>(ConfigError::Message(<span class="string">&quot;Unknown database type&quot;</span>.into())),
<span class="string">"mysql" </span>=&gt; <span class="prelude-val">Ok</span>(<span class="self">Self</span>::Maria),
<span class="string">"postgres" </span>=&gt; <span class="prelude-val">Ok</span>(<span class="self">Self</span>::Postgres),
<span class="kw">_ </span>=&gt; <span class="prelude-val">Err</span>(ConfigError::Message(<span class="string">"Unknown database type"</span>.into())),
}
}
}
@@ -763,91 +764,91 @@
<span class="kw">const </span>ENV_VAR_CONFIG: [(<span class="kw-2">&amp;</span>str, <span class="kw-2">&amp;</span>str); <span class="number">32</span>] = [
<span class="comment">/* top-level */
</span>(<span class="string">&quot;debug&quot;</span>, <span class="string">&quot;MCAPTCHA_debug&quot;</span>),
(<span class="string">&quot;commercial&quot;</span>, <span class="string">&quot;MCAPTCHA_commercial&quot;</span>),
(<span class="string">&quot;source_code&quot;</span>, <span class="string">&quot;MCAPTCHA_source_code&quot;</span>),
(<span class="string">&quot;allow_registration&quot;</span>, <span class="string">&quot;MCAPTCHA_allow_registration&quot;</span>),
(<span class="string">&quot;allow_demo&quot;</span>, <span class="string">&quot;MCAPTCHA_allow_demo&quot;</span>),
</span>(<span class="string">"debug"</span>, <span class="string">"MCAPTCHA_debug"</span>),
(<span class="string">"commercial"</span>, <span class="string">"MCAPTCHA_commercial"</span>),
(<span class="string">"source_code"</span>, <span class="string">"MCAPTCHA_source_code"</span>),
(<span class="string">"allow_registration"</span>, <span class="string">"MCAPTCHA_allow_registration"</span>),
(<span class="string">"allow_demo"</span>, <span class="string">"MCAPTCHA_allow_demo"</span>),
<span class="comment">/* database */
</span>(<span class="string">&quot;database.url&quot;</span>, <span class="string">&quot;DATABASE_URL&quot;</span>),
(<span class="string">&quot;database.pool&quot;</span>, <span class="string">&quot;MCAPTCHA_database_POOL&quot;</span>),
</span>(<span class="string">"database.url"</span>, <span class="string">"DATABASE_URL"</span>),
(<span class="string">"database.pool"</span>, <span class="string">"MCAPTCHA_database_POOL"</span>),
<span class="comment">/* redis */
</span>(<span class="string">&quot;redis.url&quot;</span>, <span class="string">&quot;MCAPTCHA_redis_URL&quot;</span>),
(<span class="string">&quot;redis.pool&quot;</span>, <span class="string">&quot;MCAPTCHA_redis_POOL&quot;</span>),
</span>(<span class="string">"redis.url"</span>, <span class="string">"MCAPTCHA_redis_URL"</span>),
(<span class="string">"redis.pool"</span>, <span class="string">"MCAPTCHA_redis_POOL"</span>),
<span class="comment">/* server */
</span>(<span class="string">&quot;server.port&quot;</span>, <span class="string">&quot;PORT&quot;</span>),
(<span class="string">&quot;server.domain&quot;</span>, <span class="string">&quot;MCAPTCHA_server_DOMAIN&quot;</span>),
(<span class="string">&quot;server.cookie_secret&quot;</span>, <span class="string">&quot;MCAPTCHA__server_COOKIE_SECRET&quot;</span>),
(<span class="string">&quot;server.ip&quot;</span>, <span class="string">&quot;MCAPTCHA__server_IP&quot;</span>),
(<span class="string">&quot;server.proxy_has_tls&quot;</span>, <span class="string">&quot;MCAPTCHA__server_PROXY_HAS_TLS&quot;</span>),
</span>(<span class="string">"server.port"</span>, <span class="string">"PORT"</span>),
(<span class="string">"server.domain"</span>, <span class="string">"MCAPTCHA_server_DOMAIN"</span>),
(<span class="string">"server.cookie_secret"</span>, <span class="string">"MCAPTCHA__server_COOKIE_SECRET"</span>),
(<span class="string">"server.ip"</span>, <span class="string">"MCAPTCHA__server_IP"</span>),
(<span class="string">"server.proxy_has_tls"</span>, <span class="string">"MCAPTCHA__server_PROXY_HAS_TLS"</span>),
<span class="comment">/* captcha */
</span>(<span class="string">&quot;captcha.salt&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_SALT&quot;</span>),
(<span class="string">&quot;captcha.gc&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_GC&quot;</span>),
(<span class="string">&quot;captcha.runners&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_RUNNERS&quot;</span>),
(<span class="string">&quot;captcha.queue_length&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_QUEUE_LENGTH&quot;</span>),
(<span class="string">&quot;captcha.enable_stats&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_ENABLE_STATS&quot;</span>),
(<span class="string">&quot;captcha.default_difficulty_strategy.avg_traffic_difficulty&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_difficulty&quot;</span>),
(<span class="string">&quot;captcha.default_difficulty_strategy.broke_my_site_traffic_difficulty&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_difficulty&quot;</span>),
(<span class="string">&quot;captcha.default_difficulty_strategy.peak_sustainable_traffic_difficulty&quot;</span>,
<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_difficulty&quot;</span>),
( <span class="string">&quot;captcha.default_difficulty_strategy.duration&quot;</span>,
<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_duration&quot;
</span>(<span class="string">"captcha.salt"</span>, <span class="string">"MCAPTCHA_captcha_SALT"</span>),
(<span class="string">"captcha.gc"</span>, <span class="string">"MCAPTCHA_captcha_GC"</span>),
(<span class="string">"captcha.runners"</span>, <span class="string">"MCAPTCHA_captcha_RUNNERS"</span>),
(<span class="string">"captcha.queue_length"</span>, <span class="string">"MCAPTCHA_captcha_QUEUE_LENGTH"</span>),
(<span class="string">"captcha.enable_stats"</span>, <span class="string">"MCAPTCHA_captcha_ENABLE_STATS"</span>),
(<span class="string">"captcha.default_difficulty_strategy.avg_traffic_difficulty"</span>, <span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_difficulty"</span>),
(<span class="string">"captcha.default_difficulty_strategy.broke_my_site_traffic_difficulty"</span>, <span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_difficulty"</span>),
(<span class="string">"captcha.default_difficulty_strategy.peak_sustainable_traffic_difficulty"</span>,
<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_difficulty"</span>),
( <span class="string">"captcha.default_difficulty_strategy.duration"</span>,
<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_duration"
</span>),
(<span class="string">&quot;captcha.default_difficulty_strategy.avg_traffic_time&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_time&quot;</span>),
(<span class="string">&quot;captcha.default_difficulty_strategy.peak_sustainable_traffic_time&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_time&quot;</span>),
(<span class="string">&quot;captcha.default_difficulty_strategy.broke_my_site_traffic_time&quot;</span>, <span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_time&quot;</span>),
(<span class="string">"captcha.default_difficulty_strategy.avg_traffic_time"</span>, <span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_time"</span>),
(<span class="string">"captcha.default_difficulty_strategy.peak_sustainable_traffic_time"</span>, <span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_time"</span>),
(<span class="string">"captcha.default_difficulty_strategy.broke_my_site_traffic_time"</span>, <span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_time"</span>),
<span class="comment">/* SMTP */
</span>(<span class="string">&quot;smtp.from&quot;</span>, <span class="string">&quot;MCAPTCHA_smtp_FROM&quot;</span>),
(<span class="string">&quot;smtp.reply&quot;</span>, <span class="string">&quot;MCAPTCHA_smtp_REPLY&quot;</span>),
(<span class="string">&quot;smtp.url&quot;</span>, <span class="string">&quot;MCAPTCHA_smtp_URL&quot;</span>),
(<span class="string">&quot;smtp.username&quot;</span>, <span class="string">&quot;MCAPTCHA_smtp_USERNAME&quot;</span>),
(<span class="string">&quot;smtp.password&quot;</span>, <span class="string">&quot;MCAPTCHA_smtp_PASSWORD&quot;</span>),
(<span class="string">&quot;smtp.port&quot;</span>, <span class="string">&quot;MCAPTCHA_smtp_PORT&quot;</span>),
</span>(<span class="string">"smtp.from"</span>, <span class="string">"MCAPTCHA_smtp_FROM"</span>),
(<span class="string">"smtp.reply"</span>, <span class="string">"MCAPTCHA_smtp_REPLY"</span>),
(<span class="string">"smtp.url"</span>, <span class="string">"MCAPTCHA_smtp_URL"</span>),
(<span class="string">"smtp.username"</span>, <span class="string">"MCAPTCHA_smtp_USERNAME"</span>),
(<span class="string">"smtp.password"</span>, <span class="string">"MCAPTCHA_smtp_PASSWORD"</span>),
(<span class="string">"smtp.port"</span>, <span class="string">"MCAPTCHA_smtp_PORT"</span>),
];
<span class="kw">const </span>DEPRECATED_ENV_VARS: [(<span class="kw-2">&amp;</span>str, <span class="kw-2">&amp;</span>str); <span class="number">23</span>] = [
(<span class="string">&quot;debug&quot;</span>, <span class="string">&quot;MCAPTCHA_DEBUG&quot;</span>),
(<span class="string">&quot;commercial&quot;</span>, <span class="string">&quot;MCAPTCHA_COMMERCIAL&quot;</span>),
(<span class="string">&quot;source_code&quot;</span>, <span class="string">&quot;MCAPTCHA_SOURCE_CODE&quot;</span>),
(<span class="string">&quot;allow_registration&quot;</span>, <span class="string">&quot;MCAPTCHA_ALLOW_REGISTRATION&quot;</span>),
(<span class="string">&quot;allow_demo&quot;</span>, <span class="string">&quot;MCAPTCHA_ALLOW_DEMO&quot;</span>),
(<span class="string">&quot;redis.pool&quot;</span>, <span class="string">&quot;MCAPTCHA_REDIS_POOL&quot;</span>),
(<span class="string">&quot;redis.url&quot;</span>, <span class="string">&quot;MCAPTCHA_REDIS_URL&quot;</span>),
(<span class="string">&quot;server.port&quot;</span>, <span class="string">&quot;MCAPTCHA_SERVER_PORT&quot;</span>),
(<span class="string">&quot;server.ip&quot;</span>, <span class="string">&quot;MCAPTCHA_SERVER_IP&quot;</span>),
(<span class="string">&quot;server.domain&quot;</span>, <span class="string">&quot;MCAPTCHA_SERVER_DOMAIN&quot;</span>),
(<span class="string">&quot;server.cookie_secret&quot;</span>, <span class="string">&quot;MCAPTCHA_SERVER_COOKIE_SECRET&quot;</span>),
(<span class="string">&quot;server.proxy_has_tls&quot;</span>, <span class="string">&quot;MCAPTCHA_SERVER_PROXY_HAS_TLS&quot;</span>),
(<span class="string">&quot;captcha.salt&quot;</span>, <span class="string">&quot;MCAPTCHA_CAPTCHA_SALT&quot;</span>),
(<span class="string">&quot;captcha.gc&quot;</span>, <span class="string">&quot;MCAPTCHA_CAPTCHA_GC&quot;</span>),
(<span class="string">"debug"</span>, <span class="string">"MCAPTCHA_DEBUG"</span>),
(<span class="string">"commercial"</span>, <span class="string">"MCAPTCHA_COMMERCIAL"</span>),
(<span class="string">"source_code"</span>, <span class="string">"MCAPTCHA_SOURCE_CODE"</span>),
(<span class="string">"allow_registration"</span>, <span class="string">"MCAPTCHA_ALLOW_REGISTRATION"</span>),
(<span class="string">"allow_demo"</span>, <span class="string">"MCAPTCHA_ALLOW_DEMO"</span>),
(<span class="string">"redis.pool"</span>, <span class="string">"MCAPTCHA_REDIS_POOL"</span>),
(<span class="string">"redis.url"</span>, <span class="string">"MCAPTCHA_REDIS_URL"</span>),
(<span class="string">"server.port"</span>, <span class="string">"MCAPTCHA_SERVER_PORT"</span>),
(<span class="string">"server.ip"</span>, <span class="string">"MCAPTCHA_SERVER_IP"</span>),
(<span class="string">"server.domain"</span>, <span class="string">"MCAPTCHA_SERVER_DOMAIN"</span>),
(<span class="string">"server.cookie_secret"</span>, <span class="string">"MCAPTCHA_SERVER_COOKIE_SECRET"</span>),
(<span class="string">"server.proxy_has_tls"</span>, <span class="string">"MCAPTCHA_SERVER_PROXY_HAS_TLS"</span>),
(<span class="string">"captcha.salt"</span>, <span class="string">"MCAPTCHA_CAPTCHA_SALT"</span>),
(<span class="string">"captcha.gc"</span>, <span class="string">"MCAPTCHA_CAPTCHA_GC"</span>),
(
<span class="string">&quot;captcha.default_difficulty_strategy.avg_traffic_difficulty&quot;</span>,
<span class="string">&quot;MCAPTCHA_CAPTCHA_AVG_TRAFFIC_DIFFICULTY&quot;</span>,
<span class="string">"captcha.default_difficulty_strategy.avg_traffic_difficulty"</span>,
<span class="string">"MCAPTCHA_CAPTCHA_AVG_TRAFFIC_DIFFICULTY"</span>,
),
(
<span class="string">&quot;captcha.default_difficulty_strategy.peak_sustainable_traffic_difficulty&quot;</span>,
<span class="string">&quot;MCAPTCHA_CAPTCHA_PEAK_TRAFFIC_DIFFICULTY&quot;</span>,
<span class="string">"captcha.default_difficulty_strategy.peak_sustainable_traffic_difficulty"</span>,
<span class="string">"MCAPTCHA_CAPTCHA_PEAK_TRAFFIC_DIFFICULTY"</span>,
),
(
<span class="string">&quot;captcha.default_difficulty_strategy.broke_my_site_traffic_difficulty&quot;</span>,
<span class="string">&quot;MCAPTCHA_CAPTCHA_BROKE_MY_SITE_TRAFFIC&quot;</span>,
<span class="string">"captcha.default_difficulty_strategy.broke_my_site_traffic_difficulty"</span>,
<span class="string">"MCAPTCHA_CAPTCHA_BROKE_MY_SITE_TRAFFIC"</span>,
),
(<span class="string">&quot;smtp.from&quot;</span>, <span class="string">&quot;MCAPTCHA_SMTP_FROM&quot;</span>),
(<span class="string">&quot;smtp.reply&quot;</span>, <span class="string">&quot;MCAPTCHA_SMTP_REPLY_TO&quot;</span>),
(<span class="string">&quot;smtp.url&quot;</span>, <span class="string">&quot;MCAPTCHA_SMTP_URL&quot;</span>),
(<span class="string">&quot;smtp.username&quot;</span>, <span class="string">&quot;MCAPTCHA_SMTP_USERNAME&quot;</span>),
(<span class="string">&quot;smtp.password&quot;</span>, <span class="string">&quot;MCAPTCHA_SMTP_PASSWORD&quot;</span>),
(<span class="string">&quot;smtp.port&quot;</span>, <span class="string">&quot;MCAPTCHA_SMTP_PORT&quot;</span>),
(<span class="string">"smtp.from"</span>, <span class="string">"MCAPTCHA_SMTP_FROM"</span>),
(<span class="string">"smtp.reply"</span>, <span class="string">"MCAPTCHA_SMTP_REPLY_TO"</span>),
(<span class="string">"smtp.url"</span>, <span class="string">"MCAPTCHA_SMTP_URL"</span>),
(<span class="string">"smtp.username"</span>, <span class="string">"MCAPTCHA_SMTP_USERNAME"</span>),
(<span class="string">"smtp.password"</span>, <span class="string">"MCAPTCHA_SMTP_PASSWORD"</span>),
(<span class="string">"smtp.port"</span>, <span class="string">"MCAPTCHA_SMTP_PORT"</span>),
];
<span class="attr">#[cfg(not(tarpaulin_include))]
@@ -855,12 +856,12 @@
<span class="kw">pub fn </span>new() -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, ConfigError&gt; {
<span class="kw">let </span><span class="kw-2">mut </span>s = Config::builder();
<span class="kw">const </span>CURRENT_DIR: <span class="kw-2">&amp;</span>str = <span class="string">&quot;./config/default.toml&quot;</span>;
<span class="kw">const </span>ETC: <span class="kw-2">&amp;</span>str = <span class="string">&quot;/etc/mcaptcha/config.toml&quot;</span>;
<span class="kw">const </span>CURRENT_DIR: <span class="kw-2">&amp;</span>str = <span class="string">"./config/default.toml"</span>;
<span class="kw">const </span>ETC: <span class="kw-2">&amp;</span>str = <span class="string">"/etc/mcaptcha/config.toml"</span>;
s = s
.set_default(<span class="string">&quot;capatcha.enable_stats&quot;</span>, <span class="bool-val">true</span>.to_string())
.expect(<span class="string">&quot;unable to set capatcha.enable_stats default config&quot;</span>);
.set_default(<span class="string">"capatcha.enable_stats"</span>, <span class="bool-val">true</span>.to_string())
.expect(<span class="string">"unable to set capatcha.enable_stats default config"</span>);
<span class="comment">// Will be overridden after config is parsed and loaded into Settings by
// Settings::set_database_type.
@@ -868,29 +869,29 @@
// inferred. But we need a default value for config lib to parse successfully, since it is
// DBType and not Option&lt;DBType&gt;
</span>s = s
.set_default(<span class="string">&quot;database.database_type&quot;</span>, DBType::Postgres.to_string())
.expect(<span class="string">&quot;unable to set database.database_type default config&quot;</span>);
.set_default(<span class="string">"database.database_type"</span>, DBType::Postgres.to_string())
.expect(<span class="string">"unable to set database.database_type default config"</span>);
<span class="kw">if let </span><span class="prelude-val">Ok</span>(path) = env::var(<span class="string">&quot;MCAPTCHA_CONFIG&quot;</span>) {
<span class="kw">if let </span><span class="prelude-val">Ok</span>(path) = env::var(<span class="string">"MCAPTCHA_CONFIG"</span>) {
<span class="kw">let </span>absolute_path = Path::new(<span class="kw-2">&amp;</span>path).canonicalize().unwrap();
<span class="macro">log::info!</span>(
<span class="string">&quot;Loading config file from {}&quot;</span>,
<span class="string">"Loading config file from {}"</span>,
absolute_path.to_str().unwrap()
);
s = s.add_source(File::with_name(absolute_path.to_str().unwrap()));
} <span class="kw">else if </span>Path::new(CURRENT_DIR).exists() {
<span class="kw">let </span>absolute_path = fs::canonicalize(CURRENT_DIR).unwrap();
<span class="macro">log::info!</span>(
<span class="string">&quot;Loading config file from {}&quot;</span>,
<span class="string">"Loading config file from {}"</span>,
absolute_path.to_str().unwrap()
);
<span class="comment">// merging default config from file
</span>s = s.add_source(File::with_name(absolute_path.to_str().unwrap()));
} <span class="kw">else if </span>Path::new(ETC).exists() {
<span class="macro">log::info!</span>(<span class="string">&quot;{}&quot;</span>, <span class="macro">format!</span>(<span class="string">&quot;Loading config file from {}&quot;</span>, ETC));
<span class="macro">log::info!</span>(<span class="string">"{}"</span>, <span class="macro">format!</span>(<span class="string">"Loading config file from {}"</span>, ETC));
s = s.add_source(File::with_name(ETC));
} <span class="kw">else </span>{
<span class="macro">log::warn!</span>(<span class="string">&quot;Configuration file not found&quot;</span>);
<span class="macro">log::warn!</span>(<span class="string">"Configuration file not found"</span>);
}
s = <span class="self">Self</span>::env_override(s);
@@ -908,19 +909,19 @@
<span class="kw">if </span>s.broke_my_site_traffic_time.is_none()
|| s.peak_sustainable_traffic_time.is_none()
{
<span class="macro">panic!</span>(<span class="string">&quot;if captcha.default_difficulty_strategy.avg_traffic_time is set, then captcha.default_difficulty_strategy.broke_my_site_traffic_time and captcha.default_difficulty_strategy.peak_sustainable_traffic_time must also be set&quot;</span>);
<span class="macro">panic!</span>(<span class="string">"if captcha.default_difficulty_strategy.avg_traffic_time is set, then captcha.default_difficulty_strategy.broke_my_site_traffic_time and captcha.default_difficulty_strategy.peak_sustainable_traffic_time must also be set"</span>);
}
}
<span class="kw">if </span>s.peak_sustainable_traffic_time.is_some() {
<span class="kw">if </span>s.avg_traffic_time.is_none() || s.peak_sustainable_traffic_time.is_none()
{
<span class="macro">panic!</span>(<span class="string">&quot;if captcha.default_difficulty_strategy.peak_sustainable_traffic_time is set, then captcha.default_difficulty_strategy.broke_my_site_traffic_time and captcha.default_difficulty_strategy.avg_traffic_time must also be set&quot;</span>);
<span class="macro">panic!</span>(<span class="string">"if captcha.default_difficulty_strategy.peak_sustainable_traffic_time is set, then captcha.default_difficulty_strategy.broke_my_site_traffic_time and captcha.default_difficulty_strategy.avg_traffic_time must also be set"</span>);
}
}
<span class="kw">if </span>s.broke_my_site_traffic_time.is_some() {
<span class="kw">if </span>s.avg_traffic_time.is_none() || s.peak_sustainable_traffic_time.is_none()
{
<span class="macro">panic!</span>(<span class="string">&quot;if captcha.default_difficulty_strategy.broke_my_site_traffic_time is set, then captcha.default_difficulty_strategy.peak_sustainable_traffic_time and captcha.default_difficulty_strategy.avg_traffic_time must also be set&quot;</span>);
<span class="macro">panic!</span>(<span class="string">"if captcha.default_difficulty_strategy.broke_my_site_traffic_time is set, then captcha.default_difficulty_strategy.peak_sustainable_traffic_time and captcha.default_difficulty_strategy.avg_traffic_time must also be set"</span>);
}
}
}
@@ -929,7 +930,7 @@
<span class="kw">for </span>(parameter, env_var_name) <span class="kw">in </span>DEPRECATED_ENV_VARS.iter() {
<span class="kw">if let </span><span class="prelude-val">Ok</span>(val) = env::var(env_var_name) {
<span class="macro">log::warn!</span>(
<span class="string">&quot;Found {env_var_name}. {env_var_name} will be deprecated soon. Please see https://github.com/mCaptcha/mCaptcha/blob/master/docs/CONFIGURATION.md for latest environment variable names&quot;
<span class="string">"Found {env_var_name}. {env_var_name} will be deprecated soon. Please see https://github.com/mCaptcha/mCaptcha/blob/master/docs/CONFIGURATION.md for latest environment variable names"
</span>);
s = s.set_override(parameter, val).unwrap();
}
@@ -938,7 +939,7 @@
<span class="kw">for </span>(parameter, env_var_name) <span class="kw">in </span>ENV_VAR_CONFIG.iter() {
<span class="kw">if let </span><span class="prelude-val">Ok</span>(val) = env::var(env_var_name) {
<span class="macro">log::debug!</span>(
<span class="string">&quot;Overriding [{parameter}] with environment variable {env_var_name}&quot;
<span class="string">"Overriding [{parameter}] with environment variable {env_var_name}"
</span>);
s = s.set_override(parameter, val).unwrap();
}
@@ -949,13 +950,13 @@
<span class="kw">fn </span>set_database_type(<span class="kw-2">&amp;mut </span><span class="self">self</span>) {
<span class="kw">let </span>url = Url::parse(<span class="kw-2">&amp;</span><span class="self">self</span>.database.url)
.expect(<span class="string">&quot;couldn&#39;t parse Database URL and detect database type&quot;</span>);
.expect(<span class="string">"couldn't parse Database URL and detect database type"</span>);
<span class="self">self</span>.database.database_type = DBType::from_url(<span class="kw-2">&amp;</span>url).unwrap();
}
<span class="kw">fn </span>check_url(<span class="kw-2">&amp;</span><span class="self">self</span>) {
Url::parse(<span class="kw-2">&amp;</span><span class="self">self</span>.source_code)
.expect(<span class="string">&quot;Please enter a URL for source_code in settings&quot;</span>);
.expect(<span class="string">"Please enter a URL for source_code in settings"</span>);
}
}
@@ -975,7 +976,7 @@
(<span class="macro-nonterminal">$env</span>:expr, <span class="macro-nonterminal">$val</span>:expr, <span class="macro-nonterminal">$val_typed</span>:expr, $(<span class="macro-nonterminal">$param</span>:ident).+) =&gt; {
<span class="macro">println!</span>(<span class="string">&quot;Setting env var {} to {} for test&quot;</span>, <span class="macro-nonterminal">$env</span>, <span class="macro-nonterminal">$val</span>);
<span class="macro">println!</span>(<span class="string">"Setting env var {} to {} for test"</span>, <span class="macro-nonterminal">$env</span>, <span class="macro-nonterminal">$val</span>);
env::set_var(<span class="macro-nonterminal">$env</span>, <span class="macro-nonterminal">$val</span>);
new_settings = get_settings();
<span class="macro">assert_eq!</span>(new_settings.$(<span class="macro-nonterminal">$param</span>).+, <span class="macro-nonterminal">$val_typed</span>);
@@ -990,21 +991,21 @@
}
<span class="comment">/* top level */
</span><span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_DEBUG&quot;</span>, !init_settings.debug, debug);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_COMMERCIAL&quot;</span>, !init_settings.commercial, commercial);
</span><span class="macro">helper!</span>(<span class="string">"MCAPTCHA_DEBUG"</span>, !init_settings.debug, debug);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_COMMERCIAL"</span>, !init_settings.commercial, commercial);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_ALLOW_REGISTRATION&quot;</span>,
<span class="string">"MCAPTCHA_ALLOW_REGISTRATION"</span>,
!init_settings.allow_registration,
allow_registration
);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_ALLOW_DEMO&quot;</span>, !init_settings.allow_demo, allow_demo);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_ALLOW_DEMO"</span>, !init_settings.allow_demo, allow_demo);
<span class="comment">/* database_type */
/* redis.url */
</span><span class="kw">let </span>env = <span class="string">&quot;MCAPTCHA_REDIS_URL&quot;</span>;
<span class="kw">let </span>val = <span class="string">&quot;redis://redis.example.org&quot;</span>;
<span class="macro">println!</span>(<span class="string">&quot;Setting env var {} to {} for test&quot;</span>, env, val);
</span><span class="kw">let </span>env = <span class="string">"MCAPTCHA_REDIS_URL"</span>;
<span class="kw">let </span>val = <span class="string">"redis://redis.example.org"</span>;
<span class="macro">println!</span>(<span class="string">"Setting env var {} to {} for test"</span>, env, val);
env::set_var(env, val);
new_settings = get_settings();
<span class="macro">assert_eq!</span>(new_settings.redis.as_ref().unwrap().url, val);
@@ -1015,9 +1016,9 @@
env::remove_var(env);
<span class="comment">/* redis.pool */
</span><span class="kw">let </span>env = <span class="string">&quot;MCAPTCHA_REDIS_POOL&quot;</span>;
</span><span class="kw">let </span>env = <span class="string">"MCAPTCHA_REDIS_POOL"</span>;
<span class="kw">let </span>val = <span class="number">999</span>;
<span class="macro">println!</span>(<span class="string">&quot;Setting env var {} to {} for test&quot;</span>, env, val);
<span class="macro">println!</span>(<span class="string">"Setting env var {} to {} for test"</span>, env, val);
env::set_var(env, val.to_string());
new_settings = get_settings();
<span class="macro">assert_eq!</span>(new_settings.redis.as_ref().unwrap().pool, val);
@@ -1027,41 +1028,41 @@
);
env::remove_var(env);
<span class="macro">helper!</span>(<span class="string">&quot;PORT&quot;</span>, <span class="number">0</span>, server.port);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_SERVER_DOMAIN&quot;</span>, <span class="string">&quot;example.org&quot;</span>, server.domain);
<span class="macro">helper!</span>(<span class="string">"PORT"</span>, <span class="number">0</span>, server.port);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_SERVER_DOMAIN"</span>, <span class="string">"example.org"</span>, server.domain);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_SERVER_COOKIE_SECRET&quot;</span>,
<span class="string">&quot;dafasdfsdf&quot;</span>,
<span class="string">"MCAPTCHA_SERVER_COOKIE_SECRET"</span>,
<span class="string">"dafasdfsdf"</span>,
server.cookie_secret
);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_SERVER_IP&quot;</span>, <span class="string">&quot;9.9.9.9&quot;</span>, server.ip);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_SERVER_PROXY_HAS_TLS&quot;</span>, <span class="bool-val">true</span>, server.proxy_has_tls);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_SERVER_IP"</span>, <span class="string">"9.9.9.9"</span>, server.ip);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_SERVER_PROXY_HAS_TLS"</span>, <span class="bool-val">true</span>, server.proxy_has_tls);
<span class="comment">/* captcha */
</span><span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_CAPTCHA_SALT&quot;</span>, <span class="string">&quot;foobarasdfasdf&quot;</span>, captcha.salt);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_CAPTCHA_GC&quot;</span>, <span class="number">500</span>, captcha.gc);
</span><span class="macro">helper!</span>(<span class="string">"MCAPTCHA_CAPTCHA_SALT"</span>, <span class="string">"foobarasdfasdf"</span>, captcha.salt);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_CAPTCHA_GC"</span>, <span class="number">500</span>, captcha.gc);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_captcha_RUNNERS&quot;</span>,
<span class="string">&quot;500&quot;</span>,
<span class="string">"MCAPTCHA_captcha_RUNNERS"</span>,
<span class="string">"500"</span>,
<span class="prelude-val">Some</span>(<span class="number">500</span>),
captcha.runners
);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_CAPTCHA_AVG_TRAFFIC_DIFFICULTY&quot;</span>,
<span class="string">"MCAPTCHA_CAPTCHA_AVG_TRAFFIC_DIFFICULTY"</span>,
<span class="number">999</span>,
captcha.default_difficulty_strategy.avg_traffic_difficulty
);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_CAPTCHA_PEAK_TRAFFIC_DIFFICULTY&quot;</span>,
<span class="string">"MCAPTCHA_CAPTCHA_PEAK_TRAFFIC_DIFFICULTY"</span>,
<span class="number">999</span>,
captcha
.default_difficulty_strategy
.peak_sustainable_traffic_difficulty
);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_CAPTCHA_BROKE_MY_SITE_TRAFFIC&quot;</span>,
<span class="string">"MCAPTCHA_CAPTCHA_BROKE_MY_SITE_TRAFFIC"</span>,
<span class="number">999</span>,
captcha
.default_difficulty_strategy
@@ -1071,28 +1072,28 @@
<span class="comment">/* SMTP */
</span><span class="kw">let </span>vals = [
<span class="string">&quot;MCAPTCHA_SMTP_FROM&quot;</span>,
<span class="string">&quot;MCAPTCHA_SMTP_REPLY_TO&quot;</span>,
<span class="string">&quot;MCAPTCHA_SMTP_URL&quot;</span>,
<span class="string">&quot;MCAPTCHA_SMTP_USERNAME&quot;</span>,
<span class="string">&quot;MCAPTCHA_SMTP_PASSWORD&quot;</span>,
<span class="string">&quot;MCAPTCHA_SMTP_PORT&quot;</span>,
<span class="string">"MCAPTCHA_SMTP_FROM"</span>,
<span class="string">"MCAPTCHA_SMTP_REPLY_TO"</span>,
<span class="string">"MCAPTCHA_SMTP_URL"</span>,
<span class="string">"MCAPTCHA_SMTP_USERNAME"</span>,
<span class="string">"MCAPTCHA_SMTP_PASSWORD"</span>,
<span class="string">"MCAPTCHA_SMTP_PORT"</span>,
];
<span class="kw">for </span>env <span class="kw">in </span>vals.iter() {
<span class="macro">println!</span>(<span class="string">&quot;Setting env var {} to {} for test&quot;</span>, env, env);
<span class="macro">println!</span>(<span class="string">"Setting env var {} to {} for test"</span>, env, env);
env::set_var(env, env);
}
<span class="kw">let </span>port = <span class="number">9999</span>;
env::set_var(<span class="string">&quot;MCAPTCHA_SMTP_PORT&quot;</span>, port.to_string());
env::set_var(<span class="string">"MCAPTCHA_SMTP_PORT"</span>, port.to_string());
new_settings = get_settings();
<span class="kw">let </span>smtp_new = new_settings.smtp.as_ref().unwrap();
<span class="kw">let </span>smtp_old = init_settings.smtp.as_ref().unwrap();
<span class="macro">assert_eq!</span>(smtp_new.from, <span class="string">&quot;MCAPTCHA_SMTP_FROM&quot;</span>);
<span class="macro">assert_eq!</span>(smtp_new.reply, <span class="string">&quot;MCAPTCHA_SMTP_REPLY_TO&quot;</span>);
<span class="macro">assert_eq!</span>(smtp_new.username, <span class="string">&quot;MCAPTCHA_SMTP_USERNAME&quot;</span>);
<span class="macro">assert_eq!</span>(smtp_new.password, <span class="string">&quot;MCAPTCHA_SMTP_PASSWORD&quot;</span>);
<span class="macro">assert_eq!</span>(smtp_new.from, <span class="string">"MCAPTCHA_SMTP_FROM"</span>);
<span class="macro">assert_eq!</span>(smtp_new.reply, <span class="string">"MCAPTCHA_SMTP_REPLY_TO"</span>);
<span class="macro">assert_eq!</span>(smtp_new.username, <span class="string">"MCAPTCHA_SMTP_USERNAME"</span>);
<span class="macro">assert_eq!</span>(smtp_new.password, <span class="string">"MCAPTCHA_SMTP_PASSWORD"</span>);
<span class="macro">assert_eq!</span>(smtp_new.port, port);
<span class="macro">assert_ne!</span>(smtp_new, smtp_old);
@@ -1112,7 +1113,7 @@
(<span class="macro-nonterminal">$env</span>:expr, <span class="macro-nonterminal">$val</span>:expr, <span class="macro-nonterminal">$val_typed</span>:expr, $(<span class="macro-nonterminal">$param</span>:ident).+) =&gt; {
<span class="macro">println!</span>(<span class="string">&quot;Setting env var {} to {} for test&quot;</span>, <span class="macro-nonterminal">$env</span>, <span class="macro-nonterminal">$val</span>);
<span class="macro">println!</span>(<span class="string">"Setting env var {} to {} for test"</span>, <span class="macro-nonterminal">$env</span>, <span class="macro-nonterminal">$val</span>);
env::set_var(<span class="macro-nonterminal">$env</span>, <span class="macro-nonterminal">$val</span>);
new_settings = get_settings();
<span class="macro">assert_eq!</span>(new_settings.$(<span class="macro-nonterminal">$param</span>).+, <span class="macro-nonterminal">$val_typed</span>);
@@ -1127,33 +1128,33 @@
}
<span class="comment">/* top level */
</span><span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_debug&quot;</span>, <span class="bool-val">false</span>, debug);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_commercial&quot;</span>, <span class="bool-val">true</span>, commercial);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_allow_registration&quot;</span>, <span class="bool-val">false</span>, allow_registration);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_allow_demo&quot;</span>, <span class="bool-val">false</span>, allow_demo);
</span><span class="macro">helper!</span>(<span class="string">"MCAPTCHA_debug"</span>, <span class="bool-val">false</span>, debug);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_commercial"</span>, <span class="bool-val">true</span>, commercial);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_allow_registration"</span>, <span class="bool-val">false</span>, allow_registration);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_allow_demo"</span>, <span class="bool-val">false</span>, allow_demo);
<span class="comment">/* database_type */
</span><span class="macro">helper!</span>(
<span class="string">&quot;DATABASE_URL&quot;</span>,
<span class="string">&quot;postgres://postgres:password@localhost:5432/postgres&quot;</span>,
<span class="string">"DATABASE_URL"</span>,
<span class="string">"postgres://postgres:password@localhost:5432/postgres"</span>,
database.url
);
<span class="macro">assert_eq!</span>(new_settings.database.database_type, DBType::Postgres);
<span class="macro">helper!</span>(
<span class="string">&quot;DATABASE_URL&quot;</span>,
<span class="string">&quot;mysql://maria:password@localhost/maria&quot;</span>,
<span class="string">"DATABASE_URL"</span>,
<span class="string">"mysql://maria:password@localhost/maria"</span>,
database.url
);
<span class="macro">assert_eq!</span>(new_settings.database.database_type, DBType::Maria);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_database_POOL&quot;</span>, <span class="number">1000</span>, database.pool);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_database_POOL"</span>, <span class="number">1000</span>, database.pool);
<span class="comment">/* redis */
/* redis.url */
</span><span class="kw">let </span>env = <span class="string">&quot;MCAPTCHA_redis_URL&quot;</span>;
<span class="kw">let </span>val = <span class="string">&quot;redis://redis.example.org&quot;</span>;
<span class="macro">println!</span>(<span class="string">&quot;Setting env var {} to {} for test&quot;</span>, env, val);
</span><span class="kw">let </span>env = <span class="string">"MCAPTCHA_redis_URL"</span>;
<span class="kw">let </span>val = <span class="string">"redis://redis.example.org"</span>;
<span class="macro">println!</span>(<span class="string">"Setting env var {} to {} for test"</span>, env, val);
env::set_var(env, val);
new_settings = get_settings();
<span class="macro">assert_eq!</span>(new_settings.redis.as_ref().unwrap().url, val);
@@ -1164,9 +1165,9 @@
env::remove_var(env);
<span class="comment">/* redis.pool */
</span><span class="kw">let </span>env = <span class="string">&quot;MCAPTCHA_redis_POOL&quot;</span>;
</span><span class="kw">let </span>env = <span class="string">"MCAPTCHA_redis_POOL"</span>;
<span class="kw">let </span>val = <span class="number">999</span>;
<span class="macro">println!</span>(<span class="string">&quot;Setting env var {} to {} for test&quot;</span>, env, val);
<span class="macro">println!</span>(<span class="string">"Setting env var {} to {} for test"</span>, env, val);
env::set_var(env, val.to_string());
new_settings = get_settings();
<span class="macro">assert_eq!</span>(new_settings.redis.as_ref().unwrap().pool, val);
@@ -1176,51 +1177,51 @@
);
env::remove_var(env);
<span class="macro">helper!</span>(<span class="string">&quot;PORT&quot;</span>, <span class="number">0</span>, server.port);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_server_DOMAIN&quot;</span>, <span class="string">&quot;example.org&quot;</span>, server.domain);
<span class="macro">helper!</span>(<span class="string">"PORT"</span>, <span class="number">0</span>, server.port);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_server_DOMAIN"</span>, <span class="string">"example.org"</span>, server.domain);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA__server_COOKIE_SECRET&quot;</span>,
<span class="string">&quot;dafasdfsdf&quot;</span>,
<span class="string">"MCAPTCHA__server_COOKIE_SECRET"</span>,
<span class="string">"dafasdfsdf"</span>,
server.cookie_secret
);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA__server_IP&quot;</span>, <span class="string">&quot;9.9.9.9&quot;</span>, server.ip);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA__server_PROXY_HAS_TLS&quot;</span>, <span class="bool-val">true</span>, server.proxy_has_tls);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA__server_IP"</span>, <span class="string">"9.9.9.9"</span>, server.ip);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA__server_PROXY_HAS_TLS"</span>, <span class="bool-val">true</span>, server.proxy_has_tls);
<span class="comment">/* captcha */
</span><span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_captcha_SALT&quot;</span>, <span class="string">&quot;foobarasdfasdf&quot;</span>, captcha.salt);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_captcha_GC&quot;</span>, <span class="number">500</span>, captcha.gc);
</span><span class="macro">helper!</span>(<span class="string">"MCAPTCHA_captcha_SALT"</span>, <span class="string">"foobarasdfasdf"</span>, captcha.salt);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_captcha_GC"</span>, <span class="number">500</span>, captcha.gc);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_captcha_RUNNERS&quot;</span>,
<span class="string">&quot;500&quot;</span>,
<span class="string">"MCAPTCHA_captcha_RUNNERS"</span>,
<span class="string">"500"</span>,
<span class="prelude-val">Some</span>(<span class="number">500</span>),
captcha.runners
);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_captcha_QUEUE_LENGTH&quot;</span>, <span class="number">500</span>, captcha.queue_length);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_captcha_ENABLE_STATS&quot;</span>, <span class="bool-val">false</span>, captcha.enable_stats);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_captcha_QUEUE_LENGTH"</span>, <span class="number">500</span>, captcha.queue_length);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_captcha_ENABLE_STATS"</span>, <span class="bool-val">false</span>, captcha.enable_stats);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_difficulty&quot;</span>,
<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_difficulty"</span>,
<span class="number">999</span>,
captcha.default_difficulty_strategy.avg_traffic_difficulty
);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_difficulty&quot;</span>, <span class="number">999 </span>, captcha.default_difficulty_strategy.peak_sustainable_traffic_difficulty);
<span class="macro">helper!</span>(<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_difficulty&quot;</span>, <span class="number">999 </span>, captcha.default_difficulty_strategy.broke_my_site_traffic_difficulty);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_difficulty"</span>, <span class="number">999 </span>, captcha.default_difficulty_strategy.peak_sustainable_traffic_difficulty);
<span class="macro">helper!</span>(<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_difficulty"</span>, <span class="number">999 </span>, captcha.default_difficulty_strategy.broke_my_site_traffic_difficulty);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_duration&quot;</span>,
<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_duration"</span>,
<span class="number">999</span>,
captcha.default_difficulty_strategy.duration
);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_time&quot;</span>,
<span class="string">&quot;10&quot;</span>,
<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_avg_traffic_time"</span>,
<span class="string">"10"</span>,
<span class="prelude-val">Some</span>(<span class="number">10</span>),
captcha.default_difficulty_strategy.avg_traffic_time
);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_time&quot;</span>,
<span class="string">&quot;20&quot;</span>,
<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_peak_sustainable_traffic_time"</span>,
<span class="string">"20"</span>,
<span class="prelude-val">Some</span>(<span class="number">20</span>),
captcha
.default_difficulty_strategy
@@ -1228,8 +1229,8 @@
);
<span class="macro">helper!</span>(
<span class="string">&quot;MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_time&quot;</span>,
<span class="string">&quot;30&quot;</span>,
<span class="string">"MCAPTCHA_captcha_DEFAULT_DIFFICULTY_STRATEGY_broke_my_site_traffic_time"</span>,
<span class="string">"30"</span>,
<span class="prelude-val">Some</span>(<span class="number">30</span>),
captcha
.default_difficulty_strategy
@@ -1239,28 +1240,28 @@
<span class="comment">/* SMTP */
</span><span class="kw">let </span>vals = [
<span class="string">&quot;MCAPTCHA_smtp_FROM&quot;</span>,
<span class="string">&quot;MCAPTCHA_smtp_REPLY&quot;</span>,
<span class="string">&quot;MCAPTCHA_smtp_URL&quot;</span>,
<span class="string">&quot;MCAPTCHA_smtp_USERNAME&quot;</span>,
<span class="string">&quot;MCAPTCHA_smtp_PASSWORD&quot;</span>,
<span class="string">&quot;MCAPTCHA_smtp_PORT&quot;</span>,
<span class="string">"MCAPTCHA_smtp_FROM"</span>,
<span class="string">"MCAPTCHA_smtp_REPLY"</span>,
<span class="string">"MCAPTCHA_smtp_URL"</span>,
<span class="string">"MCAPTCHA_smtp_USERNAME"</span>,
<span class="string">"MCAPTCHA_smtp_PASSWORD"</span>,
<span class="string">"MCAPTCHA_smtp_PORT"</span>,
];
<span class="kw">for </span>env <span class="kw">in </span>vals.iter() {
<span class="macro">println!</span>(<span class="string">&quot;Setting env var {} to {} for test&quot;</span>, env, env);
<span class="macro">println!</span>(<span class="string">"Setting env var {} to {} for test"</span>, env, env);
env::set_var(env, env);
}
<span class="kw">let </span>port = <span class="number">9999</span>;
env::set_var(<span class="string">&quot;MCAPTCHA_smtp_PORT&quot;</span>, port.to_string());
env::set_var(<span class="string">"MCAPTCHA_smtp_PORT"</span>, port.to_string());
new_settings = get_settings();
<span class="kw">let </span>smtp_new = new_settings.smtp.as_ref().unwrap();
<span class="kw">let </span>smtp_old = init_settings.smtp.as_ref().unwrap();
<span class="macro">assert_eq!</span>(smtp_new.from, <span class="string">&quot;MCAPTCHA_smtp_FROM&quot;</span>);
<span class="macro">assert_eq!</span>(smtp_new.reply, <span class="string">&quot;MCAPTCHA_smtp_REPLY&quot;</span>);
<span class="macro">assert_eq!</span>(smtp_new.username, <span class="string">&quot;MCAPTCHA_smtp_USERNAME&quot;</span>);
<span class="macro">assert_eq!</span>(smtp_new.password, <span class="string">&quot;MCAPTCHA_smtp_PASSWORD&quot;</span>);
<span class="macro">assert_eq!</span>(smtp_new.from, <span class="string">"MCAPTCHA_smtp_FROM"</span>);
<span class="macro">assert_eq!</span>(smtp_new.reply, <span class="string">"MCAPTCHA_smtp_REPLY"</span>);
<span class="macro">assert_eq!</span>(smtp_new.username, <span class="string">"MCAPTCHA_smtp_USERNAME"</span>);
<span class="macro">assert_eq!</span>(smtp_new.password, <span class="string">"MCAPTCHA_smtp_PASSWORD"</span>);
<span class="macro">assert_eq!</span>(smtp_new.port, port);
<span class="macro">assert_ne!</span>(smtp_new, smtp_old);
@@ -1273,9 +1274,9 @@
// fn url_prefix_test() {
// let mut settings = Settings::new().unwrap();
// assert!(settings.server.url_prefix.is_none());
// settings.server.url_prefix = Some(&quot;test&quot;.into());
// settings.server.url_prefix = Some("test".into());
// settings.server.check_url_prefix();
// settings.server.url_prefix = Some(&quot; &quot;.into());
// settings.server.url_prefix = Some(" ".into());
// settings.server.check_url_prefix();
// assert!(settings.server.url_prefix.is_none());
// }
@@ -1284,8 +1285,8 @@
// fn smtp_config_works() {
// let settings = Settings::new().unwrap();
// assert!(settings.smtp.is_some());
// assert_eq!(settings.smtp.as_ref().unwrap().password, &quot;password&quot;);
// assert_eq!(settings.smtp.as_ref().unwrap().username, &quot;admin&quot;);
// assert_eq!(settings.smtp.as_ref().unwrap().password, "password");
// assert_eq!(settings.smtp.as_ref().unwrap().username, "admin");
// }
</span>}
</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/static_assets/filemap.rs`."><title>filemap.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/static_assets/filemap.rs`."><title>filemap.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>
@@ -47,11 +48,11 @@
<span class="kw">impl </span>FileMap {
<span class="attr">#[allow(clippy::new_without_default)]
</span><span class="kw">pub fn </span>new() -&gt; <span class="self">Self </span>{
<span class="kw">let </span>map = <span class="macro">include_str!</span>(<span class="string">&quot;../libcachebust_data.json&quot;</span>);
<span class="kw">let </span>map = <span class="macro">include_str!</span>(<span class="string">"../libcachebust_data.json"</span>);
<span class="kw">let </span>files = Files::new(map);
<span class="self">Self </span>{ files }
}
<span class="kw">pub fn </span>get&lt;<span class="lifetime">&#39;a</span>&gt;(<span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span><span class="self">self</span>, path: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>str&gt; {
<span class="kw">pub fn </span>get&lt;<span class="lifetime">'a</span>&gt;(<span class="kw-2">&amp;</span><span class="lifetime">'a </span><span class="self">self</span>, path: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span><span class="lifetime">'a </span>str&gt; {
<span class="kw">let </span>file_path = <span class="self">self</span>.files.get_full_path(path);
file_path.map(|file_path| <span class="kw-2">&amp;</span>file_path[<span class="number">1</span>..])
}
@@ -63,9 +64,9 @@
<span class="attr">#[test]
</span><span class="kw">fn </span>filemap_works() {
<span class="kw">let </span>files = <span class="kw">super</span>::FileMap::new();
<span class="kw">let </span>css = files.get(<span class="string">&quot;./static/cache/bundle/css/main.css&quot;</span>).unwrap();
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, css);
<span class="macro">assert!</span>(css.contains(<span class="string">&quot;/assets/bundle/css&quot;</span>));
<span class="kw">let </span>css = files.get(<span class="string">"./static/cache/bundle/css/main.css"</span>).unwrap();
<span class="macro">println!</span>(<span class="string">"{}"</span>, css);
<span class="macro">assert!</span>(css.contains(<span class="string">"/assets/bundle/css"</span>));
}
}
</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/static_assets/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/static_assets/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>

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/static_assets/static_files.rs`."><title>static_files.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/static_assets/static_files.rs`."><title>static_files.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>
@@ -175,54 +176,54 @@
<span class="kw">use </span><span class="kw">crate</span>::FILES;
<span class="kw">type </span>Img = (<span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str, <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str);
<span class="kw">type </span>Img = (<span class="kw-2">&amp;</span><span class="lifetime">'static </span>str, <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str);
<span class="macro">lazy_static! </span>{
<span class="kw">pub static </span><span class="kw-2">ref </span>KEY: Img =
(FILES.get(<span class="string">&quot;./static/cache/img/svg/key.svg&quot;</span>).unwrap(), <span class="string">&quot;key&quot;</span>);
(FILES.get(<span class="string">"./static/cache/img/svg/key.svg"</span>).unwrap(), <span class="string">"key"</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>GITHUB: Img = (
FILES.get(<span class="string">&quot;./static/cache/img/svg/github.svg&quot;</span>).unwrap(),
<span class="string">&quot;Source code&quot;
FILES.get(<span class="string">"./static/cache/img/svg/github.svg"</span>).unwrap(),
<span class="string">"Source code"
</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>HOME: Img = (
FILES.get(<span class="string">&quot;./static/cache/img/svg/home.svg&quot;</span>).unwrap(),
<span class="string">&quot;Home&quot;
FILES.get(<span class="string">"./static/cache/img/svg/home.svg"</span>).unwrap(),
<span class="string">"Home"
</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>SETTINGS_ICON: Img = (
FILES.get(<span class="string">&quot;./static/cache/img/svg/settings.svg&quot;</span>).unwrap(),
<span class="string">&quot;Settings&quot;
FILES.get(<span class="string">"./static/cache/img/svg/settings.svg"</span>).unwrap(),
<span class="string">"Settings"
</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>CREDIT_CARD: Img = (
FILES.get(<span class="string">&quot;./static/cache/img/svg/credit-card.svg&quot;</span>).unwrap(),
<span class="string">&quot;Payment&quot;
FILES.get(<span class="string">"./static/cache/img/svg/credit-card.svg"</span>).unwrap(),
<span class="string">"Payment"
</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>HELP_CIRCLE: Img = (
FILES.get(<span class="string">&quot;./static/cache/img/svg/help-circle.svg&quot;</span>).unwrap(),
<span class="string">&quot;Help&quot;
FILES.get(<span class="string">"./static/cache/img/svg/help-circle.svg"</span>).unwrap(),
<span class="string">"Help"
</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>MESSAGE: Img = (
FILES
.get(<span class="string">&quot;./static/cache/img/svg/message-square.svg&quot;</span>)
.get(<span class="string">"./static/cache/img/svg/message-square.svg"</span>)
.unwrap(),
<span class="string">&quot;Message&quot;
<span class="string">"Message"
</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>DOCS_ICON: Img = (
FILES.get(<span class="string">&quot;./static/cache/img/svg/file-text.svg&quot;</span>).unwrap(),
<span class="string">&quot;Documentation&quot;
FILES.get(<span class="string">"./static/cache/img/svg/file-text.svg"</span>).unwrap(),
<span class="string">"Documentation"
</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>MCAPTCHA_TRANS_ICON: Img = (
FILES.get(<span class="string">&quot;./static/cache/img/icon-trans.png&quot;</span>).unwrap(),
<span class="string">&quot;Logo&quot;
FILES.get(<span class="string">"./static/cache/img/icon-trans.png"</span>).unwrap(),
<span class="string">"Logo"
</span>);
<span class="kw">pub static </span><span class="kw-2">ref </span>BAR_CHART: Img = (
FILES.get(<span class="string">&quot;./static/cache/img/svg/bar-chart.svg&quot;</span>).unwrap(),
<span class="string">&quot;Statistics&quot;
FILES.get(<span class="string">"./static/cache/img/svg/bar-chart.svg"</span>).unwrap(),
<span class="string">"Statistics"
</span>);
}
}
<span class="attr">#[derive(RustEmbed)]
#[folder = <span class="string">&quot;assets/&quot;</span>]
#[folder = <span class="string">"assets/"</span>]
</span><span class="kw">struct </span>Asset;
<span class="kw">fn </span>handle_assets(path: <span class="kw-2">&amp;</span>str) -&gt; HttpResponse {
@@ -236,23 +237,23 @@
HttpResponse::Ok()
.insert_header(header::CacheControl(<span class="macro">vec!</span>[
header::CacheDirective::Public,
header::CacheDirective::Extension(<span class="string">&quot;immutable&quot;</span>.into(), <span class="prelude-val">None</span>),
header::CacheDirective::Extension(<span class="string">"immutable"</span>.into(), <span class="prelude-val">None</span>),
header::CacheDirective::MaxAge(CACHE_AGE),
]))
.content_type(from_path(path).first_or_octet_stream().as_ref())
.body(body)
}
<span class="prelude-val">None </span>=&gt; HttpResponse::NotFound().body(<span class="string">&quot;404 Not Found&quot;</span>),
<span class="prelude-val">None </span>=&gt; HttpResponse::NotFound().body(<span class="string">"404 Not Found"</span>),
}
}
<span class="attr">#[get(<span class="string">&quot;/assets/{_:.*}&quot;</span>)]
<span class="attr">#[get(<span class="string">"/assets/{_:.*}"</span>)]
</span><span class="kw">pub async fn </span>static_files(path: web::Path&lt;String&gt;) -&gt; <span class="kw">impl </span>Responder {
handle_assets(<span class="kw-2">&amp;</span>path)
}
<span class="attr">#[derive(RustEmbed)]
#[folder = <span class="string">&quot;static/favicons/&quot;</span>]
#[folder = <span class="string">"static/favicons/"</span>]
</span><span class="kw">struct </span>Favicons;
<span class="kw">fn </span>handle_favicons(path: <span class="kw-2">&amp;</span>str) -&gt; HttpResponse {
@@ -266,19 +267,19 @@
HttpResponse::Ok()
.insert_header(header::CacheControl(<span class="macro">vec!</span>[
header::CacheDirective::Public,
header::CacheDirective::Extension(<span class="string">&quot;immutable&quot;</span>.into(), <span class="prelude-val">None</span>),
header::CacheDirective::Extension(<span class="string">"immutable"</span>.into(), <span class="prelude-val">None</span>),
header::CacheDirective::MaxAge(CACHE_AGE),
]))
.content_type(from_path(path).first_or_octet_stream().as_ref())
.body(body)
}
<span class="prelude-val">None </span>=&gt; HttpResponse::NotFound().body(<span class="string">&quot;404 Not Found&quot;</span>),
<span class="prelude-val">None </span>=&gt; HttpResponse::NotFound().body(<span class="string">"404 Not Found"</span>),
}
}
<span class="attr">#[get(<span class="string">&quot;/{file}&quot;</span>)]
<span class="attr">#[get(<span class="string">"/{file}"</span>)]
</span><span class="kw">pub async fn </span>favicons(path: web::Path&lt;String&gt;) -&gt; <span class="kw">impl </span>Responder {
<span class="macro">debug!</span>(<span class="string">&quot;searching favicons&quot;</span>);
<span class="macro">debug!</span>(<span class="string">"searching favicons"</span>);
handle_favicons(<span class="kw-2">&amp;</span>path)
}
@@ -298,13 +299,13 @@
<span class="kw-2">*</span><span class="kw">crate</span>::VERIFICATIN_WIDGET_JS,
<span class="kw-2">*</span><span class="kw">crate</span>::VERIFICATIN_WIDGET_CSS,
<span class="kw">crate</span>::FILES
.get(<span class="string">&quot;./static/cache/img/icon-trans.png&quot;</span>)
.get(<span class="string">"./static/cache/img/icon-trans.png"</span>)
.unwrap(),
<span class="string">&quot;/favicon.ico&quot;</span>,
<span class="string">"/favicon.ico"</span>,
];
<span class="kw">for </span>u <span class="kw">in </span>urls.iter() {
<span class="macro">println!</span>(<span class="string">&quot;[*] Testing static asset at URL: {u}&quot;</span>);
<span class="macro">println!</span>(<span class="string">"[*] Testing static asset at URL: {u}"</span>);
<span class="kw">let </span>resp =
test::call_service(<span class="kw-2">&amp;</span>app, test::TestRequest::get().uri(u).to_request())
.<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/stats.rs`."><title>stats.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/stats.rs`."><title>stats.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>
@@ -151,7 +152,7 @@
<span class="kw">impl</span>&lt;T&gt; CloneStats <span class="kw">for </span>T
<span class="kw">where
</span>T: Stats + Clone + <span class="lifetime">&#39;static</span>,
</span>T: Stats + Clone + <span class="lifetime">'static</span>,
{
<span class="kw">fn </span>clone_stats(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; Box&lt;<span class="kw">dyn </span>Stats&gt; {
Box::new(<span class="self">self</span>.clone())

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/survey.rs`."><title>survey.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/survey.rs`."><title>survey.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>
@@ -267,7 +268,7 @@
<span class="kw">impl </span>Survey {
<span class="kw">pub fn </span>new(app_ctx: AppData) -&gt; <span class="self">Self </span>{
<span class="kw">if </span>app_ctx.settings.survey.is_none() {
<span class="macro">panic!</span>(<span class="string">&quot;Survey uploader shouldn&#39;t be initialized it isn&#39;t configured, please report this bug&quot;</span>)
<span class="macro">panic!</span>(<span class="string">"Survey uploader shouldn't be initialized it isn't configured, please report this bug"</span>)
}
Survey {
client: Client::new(),
@@ -292,7 +293,7 @@
<span class="kw">let </span>fut = <span class="kw">async move </span>{
<span class="kw">loop </span>{
<span class="kw">if </span>!can_run(<span class="kw-2">&amp;mut </span>rx) {
<span class="macro">log::info!</span>(<span class="string">&quot;Stopping survey uploads&quot;</span>);
<span class="macro">log::info!</span>(<span class="string">"Stopping survey uploads"</span>);
<span class="kw">break</span>;
}
@@ -310,7 +311,7 @@
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..this.app_ctx.settings.survey.as_ref().unwrap().rate_limit {
<span class="kw">if </span>!can_run(<span class="kw-2">&amp;mut </span>rx) {
<span class="macro">log::info!</span>(<span class="string">&quot;Stopping survey uploads&quot;</span>);
<span class="macro">log::info!</span>(<span class="string">"Stopping survey uploads"</span>);
<span class="kw">break</span>;
}
sleep(Duration::new(<span class="number">1</span>, <span class="number">0</span>)).<span class="kw">await</span>;
@@ -319,10 +320,10 @@
<span class="comment">// for url in this.app_ctx.settings.survey.as_ref().unwrap().nodes.iter() {
// if !can_run(&amp;mut rx) {
// log::info!(&quot;Stopping survey uploads&quot;);
// log::info!("Stopping survey uploads");
// break;
// }
// log::info!(&quot;Uploading to survey instance {}&quot;, url);
// log::info!("Uploading to survey instance {}", url);
// }
</span>}
};
@@ -333,7 +334,7 @@
<span class="kw">let </span>res = <span class="self">self
</span>.client
.get(<span class="macro">format!</span>(
<span class="string">&quot;http://{}{}&quot;</span>,
<span class="string">"http://{}{}"</span>,
<span class="self">self</span>.app_ctx.settings.server.get_ip(),
V1_API_ROUTES.meta.health
))
@@ -344,7 +345,7 @@
}
<span class="kw">async fn </span>schedule_upload_job(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; ServiceResult&lt;()&gt; {
<span class="macro">log::debug!</span>(<span class="string">&quot;Running upload job&quot;</span>);
<span class="macro">log::debug!</span>(<span class="string">"Running upload job"</span>);
<span class="attr">#[derive(Serialize)]
</span><span class="kw">struct </span>Secret {
secret: String,
@@ -353,7 +354,7 @@
<span class="kw">loop </span>{
<span class="kw">let </span>psuedo_ids = <span class="self">self</span>.app_ctx.db.analytics_get_all_psuedo_ids(page).<span class="kw">await</span><span class="question-mark">?</span>;
<span class="kw">if </span>psuedo_ids.is_empty() {
<span class="macro">log::debug!</span>(<span class="string">&quot;upload job complete, no more IDs to upload&quot;</span>);
<span class="macro">log::debug!</span>(<span class="string">"upload job complete, no more IDs to upload"</span>);
<span class="kw">break</span>;
}
<span class="kw">for </span>id <span class="kw">in </span>psuedo_ids {
@@ -361,12 +362,12 @@
<span class="kw">if let </span><span class="prelude-val">Some</span>(secret) = <span class="self">self</span>.app_ctx.survey_secrets.get(url.as_str()) {
<span class="kw">let </span>payload = Secret { secret };
<span class="macro">log::info!</span>(<span class="string">&quot;Uploading to survey instance {} campaign {id}&quot;</span>, url);
<span class="macro">log::info!</span>(<span class="string">"Uploading to survey instance {} campaign {id}"</span>, url);
<span class="kw">let </span><span class="kw-2">mut </span>url = url.clone();
url.set_path(<span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">&quot;/mcaptcha/api/v1/{id}/upload&quot;</span>));
url.set_path(<span class="kw-2">&amp;</span><span class="macro">format!</span>(<span class="string">"/mcaptcha/api/v1/{id}/upload"</span>));
<span class="kw">let </span>resp =
<span class="self">self</span>.client.post(url).json(<span class="kw-2">&amp;</span>payload).send().<span class="kw">await</span>.unwrap();
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, resp.text().<span class="kw">await</span>.unwrap());
<span class="macro">println!</span>(<span class="string">"{}"</span>, resp.text().<span class="kw">await</span>.unwrap());
}
}
}
@@ -410,7 +411,7 @@
.survey_secrets
.set(secret_upload_auth_token, url.to_string());
<span class="kw">let </span><span class="kw-2">mut </span>url = url.clone();
url.set_path(<span class="string">&quot;/mcaptcha/api/v1/register&quot;</span>);
url.set_path(<span class="string">"/mcaptcha/api/v1/register"</span>);
<span class="kw">let </span>resp = <span class="self">self</span>.client.post(url).json(<span class="kw-2">&amp;</span>payload).send().<span class="kw">await</span>.unwrap();
}
<span class="prelude-val">Ok</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/widget/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/widget/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>
@@ -84,23 +85,23 @@
<span class="kw">pub mod </span>routes {
<span class="kw">pub struct </span>Widget {
<span class="kw">pub </span>verification_widget: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static </span>str,
<span class="kw">pub </span>verification_widget: <span class="kw-2">&amp;</span><span class="lifetime">'static </span>str,
}
<span class="kw">impl </span>Widget {
<span class="kw">pub const fn </span>new() -&gt; <span class="self">Self </span>{
Widget {
verification_widget: <span class="string">&quot;/widget&quot;</span>,
verification_widget: <span class="string">"/widget"</span>,
}
}
}
}
<span class="attr">#[derive(TemplateOnce, Clone)]
#[template(path = <span class="string">&quot;widget/index.html&quot;</span>)]
#[template(path = <span class="string">"widget/index.html"</span>)]
</span><span class="kw">pub struct </span>IndexPage;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;mCaptcha CAPTCHA verification&quot;</span>;
<span class="kw">const </span>PAGE: <span class="kw-2">&amp;</span>str = <span class="string">"mCaptcha CAPTCHA verification"</span>;
<span class="kw">impl </span>IndexPage {
<span class="kw">fn </span>new() -&gt; <span class="self">Self </span>{
@@ -113,10 +114,10 @@
}
<span class="doccomment">/// render a client side widget for CAPTCHA verification
</span><span class="attr">#[my_codegen::get(path = <span class="string">&quot;crate::WIDGET_ROUTES.verification_widget&quot;</span>)] </span><span class="comment">//, wrap = &quot;crate::CheckLogin&quot;)]
</span><span class="attr">#[my_codegen::get(path = <span class="string">"crate::WIDGET_ROUTES.verification_widget"</span>)] </span><span class="comment">//, wrap = "crate::CheckLogin")]
</span><span class="kw">async fn </span>show_widget() -&gt; PageResult&lt;<span class="kw">impl </span>Responder&gt; {
<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(<span class="kw-2">&amp;**</span>INDEX_PAGE))
}