mirror of
https://github.com/mCaptcha/cache.git
synced 2024-11-22 00:25:20 +03:00
Deploying to gh-pages from @ d0a67a712a
🚀
This commit is contained in:
parent
d62b85db00
commit
47e7653c67
18 changed files with 378 additions and 57 deletions
2
cache/constant.HIT_PER_SECOND.html
vendored
2
cache/constant.HIT_PER_SECOND.html
vendored
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Initial allocation ammount of pocket[pocket::Pocket]"><meta name="keywords" content="rust, rustlang, rust-lang, HIT_PER_SECOND"><title>cache::HIT_PER_SECOND - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="HIT_PER_SECOND" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">HIT_PER_SECOND</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#29" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const HIT_PER_SECOND: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 100;</pre><div class="docblock"><p>Initial allocation ammount of pocket[pocket::Pocket]</p>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">HIT_PER_SECOND</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#31" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const HIT_PER_SECOND: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 100;</pre><div class="docblock"><p>Initial allocation ammount of pocket[pocket::Pocket]</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<script src="../main.js"></script></body></html>
|
2
cache/constant.PKG_NAME.html
vendored
2
cache/constant.PKG_NAME.html
vendored
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `PKG_NAME` constant in crate `cache`."><meta name="keywords" content="rust, rustlang, rust-lang, PKG_NAME"><title>cache::PKG_NAME - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="PKG_NAME" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">PKG_NAME</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#34" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const PKG_NAME: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "mcap";</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">PKG_NAME</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#36" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const PKG_NAME: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "mcap";</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<script src="../main.js"></script></body></html>
|
2
cache/constant.PKG_VERSION.html
vendored
2
cache/constant.PKG_VERSION.html
vendored
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `PKG_VERSION` constant in crate `cache`."><meta name="keywords" content="rust, rustlang, rust-lang, PKG_VERSION"><title>cache::PKG_VERSION - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="PKG_VERSION" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">PKG_VERSION</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#35" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const PKG_VERSION: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 1;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">PKG_VERSION</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#37" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const PKG_VERSION: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 1;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<script src="../main.js"></script></body></html>
|
2
cache/constant.POCKET_EXPIRY_OFFSET.html
vendored
2
cache/constant.POCKET_EXPIRY_OFFSET.html
vendored
|
@ -1,7 +1,7 @@
|
|||
<!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="If pockets perform clean up at x instant, then pockets themselves will get cleaned up at x + POCKET_EXPIRY_OFFSET(if they haven’t already been cleaned up)"><meta name="keywords" content="rust, rustlang, rust-lang, POCKET_EXPIRY_OFFSET"><title>cache::POCKET_EXPIRY_OFFSET - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="POCKET_EXPIRY_OFFSET" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">POCKET_EXPIRY_OFFSET</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#47" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const POCKET_EXPIRY_OFFSET: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a> = 30;</pre><div class="docblock"><p>If pockets perform clean up at x instant, then pockets themselves will get cleaned
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">POCKET_EXPIRY_OFFSET</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#49" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const POCKET_EXPIRY_OFFSET: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a> = 30;</pre><div class="docblock"><p>If pockets perform clean up at x instant, then pockets themselves will get cleaned
|
||||
up at x + POCKET_EXPIRY_OFFSET(if they haven’t already been cleaned up)</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<script src="../main.js"></script></body></html>
|
2
cache/constant.PREFIX_POCKET_TIMER.html
vendored
2
cache/constant.PREFIX_POCKET_TIMER.html
vendored
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="pocket timer key prefix"><meta name="keywords" content="rust, rustlang, rust-lang, PREFIX_POCKET_TIMER"><title>cache::PREFIX_POCKET_TIMER - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="PREFIX_POCKET_TIMER" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">PREFIX_POCKET_TIMER</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#43" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const PREFIX_POCKET_TIMER: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "timer:";</pre><div class="docblock"><p>pocket timer key prefix</p>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">PREFIX_POCKET_TIMER</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#45" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const PREFIX_POCKET_TIMER: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "timer:";</pre><div class="docblock"><p>pocket timer key prefix</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<script src="../main.js"></script></body></html>
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Pocket[pocket::Pocket] type version"><meta name="keywords" content="rust, rustlang, rust-lang, REDIS_MCAPTCHA_POCKET_TYPE_VERSION"><title>cache::REDIS_MCAPTCHA_POCKET_TYPE_VERSION - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="REDIS_MCAPTCHA_POCKET_TYPE_VERSION" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">REDIS_MCAPTCHA_POCKET_TYPE_VERSION</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#32" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const REDIS_MCAPTCHA_POCKET_TYPE_VERSION: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a> = 1;</pre><div class="docblock"><p>Pocket[pocket::Pocket] type version</p>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">cache</a>::<wbr><a class="constant" href="">REDIS_MCAPTCHA_POCKET_TYPE_VERSION</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#34" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const REDIS_MCAPTCHA_POCKET_TYPE_VERSION: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i32.html">i32</a> = 1;</pre><div class="docblock"><p>Pocket[pocket::Pocket] type version</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<script src="../main.js"></script></body></html>
|
2
cache/fn.RedisModule_OnLoad.html
vendored
2
cache/fn.RedisModule_OnLoad.html
vendored
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RedisModule_OnLoad` fn in crate `cache`."><meta name="keywords" content="rust, rustlang, rust-lang, RedisModule_OnLoad"><title>cache::RedisModule_OnLoad - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="RedisModule_OnLoad" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">cache</a>::<wbr><a class="fn" href="">RedisModule_OnLoad</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#85-96" title="goto source code">[src]</a></span></h1><pre class="rust fn"><span class="docblock attributes">#[no_mangle]</span>pub extern "C" fn RedisModule_OnLoad(<br> ctx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>RedisModuleCtx, <br> argv: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>RedisModuleString, <br> argc: <a class="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_int.html" title="type std::os::raw::c_int">c_int</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_int.html" title="type std::os::raw::c_int">c_int</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">cache</a>::<wbr><a class="fn" href="">RedisModule_OnLoad</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#87-98" title="goto source code">[src]</a></span></h1><pre class="rust fn"><span class="docblock attributes">#[no_mangle]</span>pub extern "C" fn RedisModule_OnLoad(<br> ctx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>RedisModuleCtx, <br> argv: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>RedisModuleString, <br> argc: <a class="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_int.html" title="type std::os::raw::c_int">c_int</a><br>) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_int.html" title="type std::os::raw::c_int">c_int</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<script src="../main.js"></script></body></html>
|
2
cache/fn.RedisModule_OnUnload.html
vendored
2
cache/fn.RedisModule_OnUnload.html
vendored
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `RedisModule_OnUnload` fn in crate `cache`."><meta name="keywords" content="rust, rustlang, rust-lang, RedisModule_OnUnload"><title>cache::RedisModule_OnUnload - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="RedisModule_OnUnload" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">cache</a>::<wbr><a class="fn" href="">RedisModule_OnUnload</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#85-96" title="goto source code">[src]</a></span></h1><pre class="rust fn"><span class="docblock attributes">#[no_mangle]</span>pub extern "C" fn RedisModule_OnUnload(ctx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>RedisModuleCtx) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_int.html" title="type std::os::raw::c_int">c_int</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">cache</a>::<wbr><a class="fn" href="">RedisModule_OnUnload</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#87-98" title="goto source code">[src]</a></span></h1><pre class="rust fn"><span class="docblock attributes">#[no_mangle]</span>pub extern "C" fn RedisModule_OnUnload(ctx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>RedisModuleCtx) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_int.html" title="type std::os::raw::c_int">c_int</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="cache" data-search-js="../search-index.js"></div>
|
||||
<script src="../main.js"></script></body></html>
|
2
cache/index.html
vendored
2
cache/index.html
vendored
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `cache` crate."><meta name="keywords" content="rust, rustlang, rust-lang, cache"><title>cache - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate cache</p><div class="block version"><p>Version 0.1.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all cache's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"></p><div id="sidebar-vars" data-name="cache" data-ty="mod" data-relpath="../"></div></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">cache</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#17-96" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">cache</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#17-98" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.ID.html" title="cache::ID struct">ID</a></td><td class="docblock-short"><p>node unique identifier, useful when running in cluster mode</p>
|
||||
</td></tr><tr class="module-item"><td><a class="struct" href="struct.PREFIX_COUNTER.html" title="cache::PREFIX_COUNTER struct">PREFIX_COUNTER</a></td><td class="docblock-short"><p>counter/captcha key prefix</p>
|
||||
</td></tr><tr class="module-item"><td><a class="struct" href="struct.PREFIX_POCKET.html" title="cache::PREFIX_POCKET struct">PREFIX_POCKET</a></td><td class="docblock-short"><p>pocket key prefix</p>
|
||||
|
|
8
cache/struct.ID.html
vendored
8
cache/struct.ID.html
vendored
|
@ -1,10 +1,10 @@
|
|||
<!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="node unique identifier, useful when running in cluster mode"><meta name="keywords" content="rust, rustlang, rust-lang, ID"><title>cache::ID - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct ID</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Deref">Deref</a><a href="#impl-LazyStatic">LazyStatic</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="ID" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">cache</a>::<wbr><a class="struct" href="">ID</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct ID { /* fields omitted */ }</pre></div><div class="docblock"><p>node unique identifier, useful when running in cluster mode</p>
|
||||
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Deref" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id="method.deref" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
||||
</div></div><h3 id="impl-LazyStatic" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-LazyStatic" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.initialize" class="method hidden"><code>fn <a href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html#tymethod.initialize" class="fnname">initialize</a>(lazy: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h4></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">cache</a>::<wbr><a class="struct" href="">ID</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct ID { /* fields omitted */ }</pre></div><div class="docblock"><p>node unique identifier, useful when running in cluster mode</p>
|
||||
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Deref" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id="method.deref" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
||||
</div></div><h3 id="impl-LazyStatic" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-LazyStatic" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.initialize" class="method hidden"><code>fn <a href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html#tymethod.initialize" class="fnname">initialize</a>(lazy: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h4></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../cache/struct.ID.html" title="struct cache::ID">ID</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
|
|
8
cache/struct.PREFIX_COUNTER.html
vendored
8
cache/struct.PREFIX_COUNTER.html
vendored
|
@ -1,7 +1,7 @@
|
|||
<!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="counter/captcha key prefix"><meta name="keywords" content="rust, rustlang, rust-lang, PREFIX_COUNTER"><title>cache::PREFIX_COUNTER - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct PREFIX_COUNTER</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#deref-methods">Methods from Deref<Target=String></a><div class="sidebar-links"><a href="#method.as_bytes">as_bytes</a><a href="#method.as_str">as_str</a><a href="#method.capacity">capacity</a><a href="#method.is_empty">is_empty</a><a href="#method.len">len</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Deref">Deref</a><a href="#impl-LazyStatic">LazyStatic</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="PREFIX_COUNTER" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">cache</a>::<wbr><a class="struct" href="">PREFIX_COUNTER</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct PREFIX_COUNTER { /* fields omitted */ }</pre></div><div class="docblock"><p>counter/captcha key prefix</p>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">cache</a>::<wbr><a class="struct" href="">PREFIX_COUNTER</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct PREFIX_COUNTER { /* fields omitted */ }</pre></div><div class="docblock"><p>counter/captcha key prefix</p>
|
||||
</div><h2 id="deref-methods" class="small-section-header">Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><a href="#deref-methods" class="anchor"></a></h2><div class="impl-items"><h4 id="method.as_str" class="method"><code>pub fn <a href="#method.as_str" class="fnname">as_str</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class="since" title="Stable since Rust version 1.7.0">1.7.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#784" title="goto source code">[src]</a></h4><div class="docblock"><p>Extracts a string slice containing the entire <code>String</code>.</p>
|
||||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
@ -50,9 +50,9 @@ length of the string.</p>
|
|||
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="string">'a'</span>);
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">is_empty</span>());</pre></div>
|
||||
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Deref" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id="method.deref" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
||||
</div></div><h3 id="impl-LazyStatic" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-LazyStatic" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.initialize" class="method hidden"><code>fn <a href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html#tymethod.initialize" class="fnname">initialize</a>(lazy: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h4></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Deref" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id="method.deref" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
||||
</div></div><h3 id="impl-LazyStatic" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-LazyStatic" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.initialize" class="method hidden"><code>fn <a href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html#tymethod.initialize" class="fnname">initialize</a>(lazy: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h4></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../cache/struct.PREFIX_COUNTER.html" title="struct cache::PREFIX_COUNTER">PREFIX_COUNTER</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
|
|
8
cache/struct.PREFIX_POCKET.html
vendored
8
cache/struct.PREFIX_POCKET.html
vendored
|
@ -1,7 +1,7 @@
|
|||
<!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="pocket key prefix"><meta name="keywords" content="rust, rustlang, rust-lang, PREFIX_POCKET"><title>cache::PREFIX_POCKET - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../cache/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct PREFIX_POCKET</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#deref-methods">Methods from Deref<Target=String></a><div class="sidebar-links"><a href="#method.as_bytes">as_bytes</a><a href="#method.as_str">as_str</a><a href="#method.capacity">capacity</a><a href="#method.is_empty">is_empty</a><a href="#method.len">len</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Deref">Deref</a><a href="#impl-LazyStatic">LazyStatic</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="index.html">cache</a></p><div id="sidebar-vars" data-name="PREFIX_POCKET" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">cache</a>::<wbr><a class="struct" href="">PREFIX_POCKET</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct PREFIX_POCKET { /* fields omitted */ }</pre></div><div class="docblock"><p>pocket key prefix</p>
|
||||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">cache</a>::<wbr><a class="struct" href="">PREFIX_POCKET</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct PREFIX_POCKET { /* fields omitted */ }</pre></div><div class="docblock"><p>pocket key prefix</p>
|
||||
</div><h2 id="deref-methods" class="small-section-header">Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><a href="#deref-methods" class="anchor"></a></h2><div class="impl-items"><h4 id="method.as_str" class="method"><code>pub fn <a href="#method.as_str" class="fnname">as_str</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class="since" title="Stable since Rust version 1.7.0">1.7.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#784" title="goto source code">[src]</a></h4><div class="docblock"><p>Extracts a string slice containing the entire <code>String</code>.</p>
|
||||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
||||
<p>Basic usage:</p>
|
||||
|
@ -50,9 +50,9 @@ length of the string.</p>
|
|||
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="string">'a'</span>);
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="op">!</span><span class="ident">v</span>.<span class="ident">is_empty</span>());</pre></div>
|
||||
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Deref" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id="method.deref" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
||||
</div></div><h3 id="impl-LazyStatic" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-LazyStatic" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.initialize" class="method hidden"><code>fn <a href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html#tymethod.initialize" class="fnname">initialize</a>(lazy: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><a class="srclink" href="../src/cache/lib.rs.html#49-60" title="goto source code">[src]</a></h4></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Deref" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-Deref" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Target" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="type">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id="method.deref" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
|
||||
</div></div><h3 id="impl-LazyStatic" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-LazyStatic" class="anchor"></a><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.initialize" class="method hidden"><code>fn <a href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html#tymethod.initialize" class="fnname">initialize</a>(lazy: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><a class="srclink" href="../src/cache/lib.rs.html#51-62" title="goto source code">[src]</a></h4></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../cache/struct.PREFIX_POCKET.html" title="struct cache::PREFIX_POCKET">PREFIX_POCKET</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
var N = null;var sourcesIndex = {};
|
||||
sourcesIndex["cache"] = {"name":"","files":["errors.rs","lib.rs","pocket.rs","utils.rs"]};
|
||||
sourcesIndex["cache"] = {"name":"","files":["errors.rs","lib.rs","mcaptcha.rs","pocket.rs","utils.rs"]};
|
||||
createSourceSidebar();
|
||||
|
|
76
src/cache/errors.rs.html
vendored
76
src/cache/errors.rs.html
vendored
|
@ -58,6 +58,33 @@
|
|||
<span id="55">55</span>
|
||||
<span id="56">56</span>
|
||||
<span id="57">57</span>
|
||||
<span id="58">58</span>
|
||||
<span id="59">59</span>
|
||||
<span id="60">60</span>
|
||||
<span id="61">61</span>
|
||||
<span id="62">62</span>
|
||||
<span id="63">63</span>
|
||||
<span id="64">64</span>
|
||||
<span id="65">65</span>
|
||||
<span id="66">66</span>
|
||||
<span id="67">67</span>
|
||||
<span id="68">68</span>
|
||||
<span id="69">69</span>
|
||||
<span id="70">70</span>
|
||||
<span id="71">71</span>
|
||||
<span id="72">72</span>
|
||||
<span id="73">73</span>
|
||||
<span id="74">74</span>
|
||||
<span id="75">75</span>
|
||||
<span id="76">76</span>
|
||||
<span id="77">77</span>
|
||||
<span id="78">78</span>
|
||||
<span id="79">79</span>
|
||||
<span id="80">80</span>
|
||||
<span id="81">81</span>
|
||||
<span id="82">82</span>
|
||||
<span id="83">83</span>
|
||||
<span id="84">84</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="comment">/*
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
|
@ -76,46 +103,73 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/</span>
|
||||
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">num</span>::<span class="ident">ParseIntError</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">RedisError</span>;
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">RedisResult</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">CacheError</span> {
|
||||
<span class="kw">pub</span> <span class="ident">msg</span>: <span class="ident">String</span>,
|
||||
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">CacheError</span> {
|
||||
<span class="ident">Msg</span>(<span class="ident">String</span>),
|
||||
<span class="ident">RedisError</span>(<span class="ident">redis_module</span>::<span class="ident">RedisError</span>),
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">CacheError</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">msg</span>: <span class="ident">String</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="self">Self</span> { <span class="ident">msg</span> }
|
||||
<span class="ident">CacheError</span>::<span class="ident">Msg</span>(<span class="ident">msg</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CacheError</span> {
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">e</span>: <span class="ident">String</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="ident">CacheError</span> { <span class="ident">msg</span>: <span class="ident">e</span> }
|
||||
<span class="ident">CacheError</span>::<span class="ident">Msg</span>(<span class="ident">e</span>.<span class="ident">to_string</span>())
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="kw-2">&</span><span class="ident">str</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CacheError</span> {
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">e</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="ident">CacheError</span> { <span class="ident">msg</span>: <span class="ident">e</span>.<span class="ident">to_string</span>() }
|
||||
<span class="ident">CacheError</span>::<span class="ident">Msg</span>(<span class="ident">e</span>.<span class="ident">to_string</span>())
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">serde_json</span>::<span class="ident">Error</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CacheError</span> {
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">e</span>: <span class="ident">serde_json</span>::<span class="ident">Error</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="ident">CacheError</span> { <span class="ident">msg</span>: <span class="ident">e</span>.<span class="ident">to_string</span>() }
|
||||
<span class="ident">CacheError</span>::<span class="ident">Msg</span>(<span class="ident">e</span>.<span class="ident">to_string</span>())
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">CacheError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">redis_module</span>::<span class="ident">RedisError</span> {
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">e</span>: <span class="ident">CacheError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="ident">redis_module</span>::<span class="ident">RedisError</span>::<span class="ident">String</span>(<span class="ident">e</span>.<span class="ident">msg</span>)
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">redis_module</span>::<span class="ident">RedisError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CacheError</span> {
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">e</span>: <span class="ident">redis_module</span>::<span class="ident">RedisError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="ident">CacheError</span>::<span class="ident">RedisError</span>(<span class="ident">e</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">CacheError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">redis_module</span>::<span class="ident">RedisResult</span> {
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">CacheError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">RedisError</span> {
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">e</span>: <span class="ident">CacheError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="prelude-val">Err</span>(<span class="ident">redis_module</span>::<span class="ident">RedisError</span>::<span class="ident">String</span>(<span class="ident">e</span>.<span class="ident">msg</span>))
|
||||
<span class="kw">match</span> <span class="ident">e</span> {
|
||||
<span class="ident">CacheError</span>::<span class="ident">Msg</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">></span> <span class="ident">RedisError</span>::<span class="ident">String</span>(<span class="ident">val</span>),
|
||||
<span class="ident">CacheError</span>::<span class="ident">RedisError</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">></span> <span class="ident">val</span>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">ParseIntError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">CacheError</span> {
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">e</span>: <span class="ident">ParseIntError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="kw">let</span> <span class="ident">err</span>: <span class="ident">RedisError</span> <span class="op">=</span> <span class="ident">e</span>.<span class="ident">into</span>();
|
||||
<span class="ident">CacheError</span>::<span class="ident">RedisError</span>(<span class="ident">err</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">CacheError</span><span class="op">></span> <span class="kw">for</span> <span class="ident">RedisResult</span> {
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">e</span>: <span class="ident">CacheError</span>) <span class="op">-</span><span class="op">></span> <span class="self">Self</span> {
|
||||
<span class="kw">match</span> <span class="ident">e</span> {
|
||||
<span class="ident">CacheError</span>::<span class="ident">Msg</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">RedisError</span>::<span class="ident">String</span>(<span class="ident">val</span>)),
|
||||
<span class="ident">CacheError</span>::<span class="ident">RedisError</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">val</span>),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">type</span> <span class="ident">CacheResult</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">T</span>, <span class="ident">CacheError</span><span class="op">></span>;
|
||||
</pre></div>
|
||||
</section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="cache" data-search-js="../../search-index.js"></div>
|
||||
<script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script></body></html>
|
4
src/cache/lib.rs.html
vendored
4
src/cache/lib.rs.html
vendored
|
@ -97,6 +97,8 @@
|
|||
<span id="94">94</span>
|
||||
<span id="95">95</span>
|
||||
<span id="96">96</span>
|
||||
<span id="97">97</span>
|
||||
<span id="98">98</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="comment">/*
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
|
@ -120,6 +122,8 @@
|
|||
<span class="kw">use</span> <span class="ident">redis_module</span>::{<span class="ident">Context</span>, <span class="ident">NextArg</span>, <span class="ident">RedisResult</span>, <span class="ident">REDIS_OK</span>};
|
||||
|
||||
<span class="kw">mod</span> <span class="ident">errors</span>;
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>, <span class="ident">unused_features</span>, <span class="ident">unused_variables</span>)]</span>
|
||||
<span class="kw">mod</span> <span class="ident">mcaptcha</span>;
|
||||
<span class="kw">mod</span> <span class="ident">pocket</span>;
|
||||
<span class="kw">mod</span> <span class="ident">utils</span>;
|
||||
|
||||
|
|
255
src/cache/mcaptcha.rs.html
vendored
Normal file
255
src/cache/mcaptcha.rs.html
vendored
Normal file
|
@ -0,0 +1,255 @@
|
|||
<!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/mcaptcha.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mcaptcha.rs - source</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc source"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../cache/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><pre class="line-numbers"><span id="1"> 1</span>
|
||||
<span id="2"> 2</span>
|
||||
<span id="3"> 3</span>
|
||||
<span id="4"> 4</span>
|
||||
<span id="5"> 5</span>
|
||||
<span id="6"> 6</span>
|
||||
<span id="7"> 7</span>
|
||||
<span id="8"> 8</span>
|
||||
<span id="9"> 9</span>
|
||||
<span id="10"> 10</span>
|
||||
<span id="11"> 11</span>
|
||||
<span id="12"> 12</span>
|
||||
<span id="13"> 13</span>
|
||||
<span id="14"> 14</span>
|
||||
<span id="15"> 15</span>
|
||||
<span id="16"> 16</span>
|
||||
<span id="17"> 17</span>
|
||||
<span id="18"> 18</span>
|
||||
<span id="19"> 19</span>
|
||||
<span id="20"> 20</span>
|
||||
<span id="21"> 21</span>
|
||||
<span id="22"> 22</span>
|
||||
<span id="23"> 23</span>
|
||||
<span id="24"> 24</span>
|
||||
<span id="25"> 25</span>
|
||||
<span id="26"> 26</span>
|
||||
<span id="27"> 27</span>
|
||||
<span id="28"> 28</span>
|
||||
<span id="29"> 29</span>
|
||||
<span id="30"> 30</span>
|
||||
<span id="31"> 31</span>
|
||||
<span id="32"> 32</span>
|
||||
<span id="33"> 33</span>
|
||||
<span id="34"> 34</span>
|
||||
<span id="35"> 35</span>
|
||||
<span id="36"> 36</span>
|
||||
<span id="37"> 37</span>
|
||||
<span id="38"> 38</span>
|
||||
<span id="39"> 39</span>
|
||||
<span id="40"> 40</span>
|
||||
<span id="41"> 41</span>
|
||||
<span id="42"> 42</span>
|
||||
<span id="43"> 43</span>
|
||||
<span id="44"> 44</span>
|
||||
<span id="45"> 45</span>
|
||||
<span id="46"> 46</span>
|
||||
<span id="47"> 47</span>
|
||||
<span id="48"> 48</span>
|
||||
<span id="49"> 49</span>
|
||||
<span id="50"> 50</span>
|
||||
<span id="51"> 51</span>
|
||||
<span id="52"> 52</span>
|
||||
<span id="53"> 53</span>
|
||||
<span id="54"> 54</span>
|
||||
<span id="55"> 55</span>
|
||||
<span id="56"> 56</span>
|
||||
<span id="57"> 57</span>
|
||||
<span id="58"> 58</span>
|
||||
<span id="59"> 59</span>
|
||||
<span id="60"> 60</span>
|
||||
<span id="61"> 61</span>
|
||||
<span id="62"> 62</span>
|
||||
<span id="63"> 63</span>
|
||||
<span id="64"> 64</span>
|
||||
<span id="65"> 65</span>
|
||||
<span id="66"> 66</span>
|
||||
<span id="67"> 67</span>
|
||||
<span id="68"> 68</span>
|
||||
<span id="69"> 69</span>
|
||||
<span id="70"> 70</span>
|
||||
<span id="71"> 71</span>
|
||||
<span id="72"> 72</span>
|
||||
<span id="73"> 73</span>
|
||||
<span id="74"> 74</span>
|
||||
<span id="75"> 75</span>
|
||||
<span id="76"> 76</span>
|
||||
<span id="77"> 77</span>
|
||||
<span id="78"> 78</span>
|
||||
<span id="79"> 79</span>
|
||||
<span id="80"> 80</span>
|
||||
<span id="81"> 81</span>
|
||||
<span id="82"> 82</span>
|
||||
<span id="83"> 83</span>
|
||||
<span id="84"> 84</span>
|
||||
<span id="85"> 85</span>
|
||||
<span id="86"> 86</span>
|
||||
<span id="87"> 87</span>
|
||||
<span id="88"> 88</span>
|
||||
<span id="89"> 89</span>
|
||||
<span id="90"> 90</span>
|
||||
<span id="91"> 91</span>
|
||||
<span id="92"> 92</span>
|
||||
<span id="93"> 93</span>
|
||||
<span id="94"> 94</span>
|
||||
<span id="95"> 95</span>
|
||||
<span id="96"> 96</span>
|
||||
<span id="97"> 97</span>
|
||||
<span id="98"> 98</span>
|
||||
<span id="99"> 99</span>
|
||||
<span id="100">100</span>
|
||||
<span id="101">101</span>
|
||||
<span id="102">102</span>
|
||||
<span id="103">103</span>
|
||||
<span id="104">104</span>
|
||||
<span id="105">105</span>
|
||||
<span id="106">106</span>
|
||||
<span id="107">107</span>
|
||||
<span id="108">108</span>
|
||||
<span id="109">109</span>
|
||||
<span id="110">110</span>
|
||||
<span id="111">111</span>
|
||||
<span id="112">112</span>
|
||||
<span id="113">113</span>
|
||||
<span id="114">114</span>
|
||||
<span id="115">115</span>
|
||||
<span id="116">116</span>
|
||||
<span id="117">117</span>
|
||||
<span id="118">118</span>
|
||||
<span id="119">119</span>
|
||||
<span id="120">120</span>
|
||||
<span id="121">121</span>
|
||||
<span id="122">122</span>
|
||||
<span id="123">123</span>
|
||||
<span id="124">124</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="comment">/*
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/</span>
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">native_types</span>::<span class="ident">RedisType</span>;
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">raw</span>;
|
||||
<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">pocket</span>::<span class="ident">Format</span>;
|
||||
|
||||
<span class="kw">const</span> <span class="ident">REDIS_MCPATCHA_MCAPTCHA_TYPE_VERSION</span>: <span class="ident">i32</span> <span class="op">=</span> <span class="number">1</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>)]</span>
|
||||
<span class="kw">struct</span> <span class="ident">MCaptcha</span> {
|
||||
<span class="ident">m</span>: <span class="ident">libmcaptcha</span>::<span class="ident">MCaptcha</span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">MCaptcha</span> {
|
||||
<span class="doccomment">/// increments the visitor count by one</span>
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">add_visitor</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>) {
|
||||
<span class="self">self</span>.<span class="ident">m</span>.<span class="ident">add_visitor</span>()
|
||||
}
|
||||
|
||||
<span class="doccomment">/// decrements the visitor count by one</span>
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">decrement_visitor</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>) {
|
||||
<span class="self">self</span>.<span class="ident">m</span>.<span class="ident">decrement_visitor</span>()
|
||||
}
|
||||
|
||||
<span class="doccomment">/// get current difficulty factor</span>
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_difficulty</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u32</span> {
|
||||
<span class="self">self</span>.<span class="ident">m</span>.<span class="ident">get_difficulty</span>()
|
||||
}
|
||||
|
||||
<span class="doccomment">/// get [Counter]'s lifetime</span>
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_duration</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u64</span> {
|
||||
<span class="self">self</span>.<span class="ident">m</span>.<span class="ident">get_duration</span>()
|
||||
}
|
||||
|
||||
<span class="doccomment">/// get [Counter]'s current visitor_threshold</span>
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_visitors</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">u32</span> {
|
||||
<span class="self">self</span>.<span class="ident">m</span>.<span class="ident">get_visitors</span>()
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">static</span> <span class="ident">MCAPTCHA_POCKET_TYPE</span>: <span class="ident">RedisType</span> <span class="op">=</span> <span class="ident">RedisType</span>::<span class="ident">new</span>(
|
||||
<span class="string">"mcaptmcapa"</span>,
|
||||
<span class="ident">REDIS_MCPATCHA_MCAPTCHA_TYPE_VERSION</span>,
|
||||
<span class="ident">raw</span>::<span class="ident">RedisModuleTypeMethods</span> {
|
||||
<span class="ident">version</span>: <span class="ident">raw</span>::<span class="ident">REDISMODULE_TYPE_METHOD_VERSION</span> <span class="kw">as</span> <span class="ident">u64</span>,
|
||||
<span class="ident">rdb_load</span>: <span class="prelude-val">Some</span>(<span class="ident">type_methods</span>::<span class="ident">rdb_load</span>),
|
||||
<span class="ident">rdb_save</span>: <span class="prelude-val">Some</span>(<span class="ident">type_methods</span>::<span class="ident">rdb_save</span>),
|
||||
<span class="ident">aof_rewrite</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">free</span>: <span class="prelude-val">Some</span>(<span class="ident">type_methods</span>::<span class="ident">free</span>),
|
||||
|
||||
<span class="comment">// Currently unused by Redis</span>
|
||||
<span class="ident">mem_usage</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">digest</span>: <span class="prelude-val">None</span>,
|
||||
|
||||
<span class="comment">// Aux data</span>
|
||||
<span class="ident">aux_load</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">aux_save</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">aux_save_triggers</span>: <span class="number">0</span>,
|
||||
|
||||
<span class="ident">free_effort</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">unlink</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">copy</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">defrag</span>: <span class="prelude-val">None</span>,
|
||||
},
|
||||
);
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">type_methods</span> {
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">os</span>::<span class="ident">raw</span>::<span class="ident">c_void</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">libc</span>::<span class="ident">c_int</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">non_snake_case</span>, <span class="ident">unused</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">extern</span> <span class="string">"C"</span> <span class="kw">fn</span> <span class="ident">rdb_load</span>(<span class="ident">rdb</span>: <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">raw</span>::<span class="ident">RedisModuleIO</span>, <span class="ident">encver</span>: <span class="ident">c_int</span>) <span class="op">-</span><span class="op">></span> <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">c_void</span> {
|
||||
<span class="kw">let</span> <span class="ident">mcaptcha</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">encver</span> {
|
||||
<span class="number">0</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">raw</span>::<span class="ident">load_string</span>(<span class="ident">rdb</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">fmt</span> <span class="op">=</span> <span class="ident">Format</span>::<span class="ident">JSON</span>;
|
||||
<span class="kw">let</span> <span class="ident">mcaptcha</span>: <span class="ident">MCaptcha</span> <span class="op">=</span> <span class="ident">fmt</span>.<span class="ident">from_str</span>(<span class="kw-2">&</span><span class="ident">data</span>).<span class="ident">unwrap</span>();
|
||||
<span class="ident">mcaptcha</span>
|
||||
}
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">panic</span><span class="macro">!</span>(<span class="string">"Can't load old RedisJSON RDB"</span>),
|
||||
};
|
||||
|
||||
<span class="ident">Box</span>::<span class="ident">into_raw</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">mcaptcha</span>)) <span class="kw">as</span> <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">c_void</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">unsafe</span> <span class="kw">extern</span> <span class="string">"C"</span> <span class="kw">fn</span> <span class="ident">free</span>(<span class="ident">value</span>: <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">c_void</span>) {
|
||||
<span class="kw">let</span> <span class="ident">val</span> <span class="op">=</span> <span class="ident">value</span> <span class="kw">as</span> <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">MCaptcha</span>;
|
||||
<span class="ident">Box</span>::<span class="ident">from_raw</span>(<span class="ident">val</span>);
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">non_snake_case</span>, <span class="ident">unused</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">unsafe</span> <span class="kw">extern</span> <span class="string">"C"</span> <span class="kw">fn</span> <span class="ident">rdb_save</span>(<span class="ident">rdb</span>: <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">raw</span>::<span class="ident">RedisModuleIO</span>, <span class="ident">value</span>: <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">c_void</span>) {
|
||||
<span class="kw">let</span> <span class="ident">mcaptcha</span> <span class="op">=</span> <span class="kw-2">&</span><span class="kw-2">*</span>(<span class="ident">value</span> <span class="kw">as</span> <span class="kw-2">*</span><span class="kw-2">mut</span> <span class="ident">MCaptcha</span>);
|
||||
<span class="kw">match</span> <span class="kw-2">&</span><span class="ident">serde_json</span>::<span class="ident">to_string</span>(<span class="ident">mcaptcha</span>) {
|
||||
<span class="prelude-val">Ok</span>(<span class="ident">string</span>) <span class="op">=</span><span class="op">></span> <span class="ident">raw</span>::<span class="ident">save_string</span>(<span class="ident">rdb</span>, <span class="kw-2">&</span><span class="ident">string</span>),
|
||||
<span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span><span class="op">></span> <span class="macro">eprintln</span><span class="macro">!</span>(<span class="string">"error while rdb_save: {}"</span>, <span class="ident">e</span>),
|
||||
}
|
||||
}
|
||||
}
|
||||
</pre></div>
|
||||
</section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="cache" data-search-js="../../search-index.js"></div>
|
||||
<script src="../../main.js"></script><script src="../../source-script.js"></script><script src="../../source-files.js"></script></body></html>
|
48
src/cache/pocket.rs.html
vendored
48
src/cache/pocket.rs.html
vendored
|
@ -282,6 +282,11 @@
|
|||
<span id="279">279</span>
|
||||
<span id="280">280</span>
|
||||
<span id="281">281</span>
|
||||
<span id="282">282</span>
|
||||
<span id="283">283</span>
|
||||
<span id="284">284</span>
|
||||
<span id="285">285</span>
|
||||
<span id="286">286</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="comment">/*
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
|
@ -301,7 +306,6 @@
|
|||
*/</span>
|
||||
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">HashMap</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">os</span>::<span class="ident">raw</span>::<span class="ident">c_void</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::<span class="ident">Duration</span>;
|
||||
<span class="comment">//use std::time::{SystemTime, UNIX_EPOCH};</span>
|
||||
|
||||
|
@ -309,11 +313,11 @@
|
|||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">native_types</span>::<span class="ident">RedisType</span>;
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">raw</span>::<span class="ident">KeyType</span>;
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">NotifyEvent</span>;
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">RedisError</span>;
|
||||
<span class="comment">//use redis_module::RedisError;</span>
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::{<span class="ident">raw</span>, <span class="ident">Context</span>};
|
||||
<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">errors</span>::<span class="ident">CacheError</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">errors</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">utils</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="kw-2">*</span>;
|
||||
|
||||
|
@ -323,6 +327,20 @@
|
|||
<span class="ident">JSON</span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Format</span> {
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_str</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span>: <span class="ident">Deserialize</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">data</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="ident">CacheResult</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
|
||||
<span class="kw">match</span> <span class="self">self</span> {
|
||||
<span class="ident">Format</span>::<span class="ident">JSON</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">serde_json</span>::<span class="ident">from_str</span>(<span class="ident">data</span>)<span class="question-mark">?</span>),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_str</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span>: <span class="ident">Deserialize</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">data</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="ident">CacheResult</span><span class="op"><</span><span class="ident">T</span><span class="op">></span> {
|
||||
<span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">parse_str</span>(<span class="ident">data</span>)<span class="question-mark">?</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Deserialize</span>, <span class="ident">Serialize</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Pocket</span> {
|
||||
<span class="doccomment">/// timer ID</span>
|
||||
|
@ -363,7 +381,7 @@
|
|||
|
||||
<span class="doccomment">/// creates new pocket and sets off timer to go off at `duration`</span>
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="ident">Context</span>, <span class="ident">duration</span>: <span class="ident">u64</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">RedisError</span><span class="op">></span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="ident">Context</span>, <span class="ident">duration</span>: <span class="ident">u64</span>) <span class="op">-</span><span class="op">></span> <span class="ident">CacheResult</span><span class="op"><</span><span class="self">Self</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">decrement</span> <span class="op">=</span> <span class="ident">HashMap</span>::<span class="ident">with_capacity</span>(<span class="ident">HIT_PER_SECOND</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">pocket_instant</span> <span class="op">=</span> <span class="ident">get_pocket_instant</span>(<span class="ident">duration</span>)<span class="question-mark">?</span>;
|
||||
|
@ -383,7 +401,7 @@
|
|||
|
||||
<span class="doccomment">/// increments count of key = captcha and registers for auto decrement</span>
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">increment</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="ident">Context</span>, <span class="ident">duration</span>: <span class="ident">u64</span>, <span class="ident">captcha</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">RedisError</span><span class="op">></span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">increment</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="ident">Context</span>, <span class="ident">duration</span>: <span class="ident">u64</span>, <span class="ident">captcha</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-</span><span class="op">></span> <span class="ident">CacheResult</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">captcha_name</span> <span class="op">=</span> <span class="ident">get_captcha_key</span>(<span class="ident">captcha</span>);
|
||||
<span class="ident">ctx</span>.<span class="ident">log_debug</span>(<span class="kw-2">&</span><span class="ident">captcha_name</span>);
|
||||
<span class="comment">// increment</span>
|
||||
|
@ -491,22 +509,10 @@
|
|||
<span class="prelude-val">Ok</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> (),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_str</span>(<span class="ident">data</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">format</span>: <span class="ident">Format</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Pocket</span>, <span class="ident">CacheError</span><span class="op">></span> {
|
||||
<span class="kw">match</span> <span class="ident">format</span> {
|
||||
<span class="ident">Format</span>::<span class="ident">JSON</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">serde_json</span>::<span class="ident">from_str</span>(<span class="ident">data</span>)<span class="question-mark">?</span>),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">data</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">format</span>: <span class="ident">Format</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident">CacheError</span><span class="op">></span> {
|
||||
<span class="prelude-val">Ok</span>(<span class="ident">Pocket</span>::<span class="ident">parse_str</span>(<span class="ident">data</span>, <span class="ident">format</span>)<span class="question-mark">?</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">static</span> <span class="ident">MCAPTCHA_POCKET_TYPE</span>: <span class="ident">RedisType</span> <span class="op">=</span> <span class="ident">RedisType</span>::<span class="ident">new</span>(
|
||||
<span class="string">"mcaptchac"</span>,
|
||||
<span class="string">"mcaptbuck"</span>,
|
||||
<span class="ident">REDIS_MCAPTCHA_POCKET_TYPE_VERSION</span>,
|
||||
<span class="ident">raw</span>::<span class="ident">RedisModuleTypeMethods</span> {
|
||||
<span class="ident">version</span>: <span class="ident">raw</span>::<span class="ident">REDISMODULE_TYPE_METHOD_VERSION</span> <span class="kw">as</span> <span class="ident">u64</span>,
|
||||
|
@ -532,6 +538,8 @@
|
|||
);
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">type_methods</span> {
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">os</span>::<span class="ident">raw</span>::<span class="ident">c_void</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">libc</span>::<span class="ident">c_int</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
|
||||
|
@ -541,7 +549,9 @@
|
|||
<span class="kw">let</span> <span class="ident">pocket</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">encver</span> {
|
||||
<span class="number">0</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">raw</span>::<span class="ident">load_string</span>(<span class="ident">rdb</span>);
|
||||
<span class="ident">Pocket</span>::<span class="ident">from_str</span>(<span class="kw-2">&</span><span class="ident">data</span>, <span class="ident">Format</span>::<span class="ident">JSON</span>).<span class="ident">unwrap</span>()
|
||||
<span class="kw">let</span> <span class="ident">fmt</span> <span class="op">=</span> <span class="ident">Format</span>::<span class="ident">JSON</span>;
|
||||
<span class="kw">let</span> <span class="ident">pocket</span>: <span class="ident">Pocket</span> <span class="op">=</span> <span class="ident">fmt</span>.<span class="ident">from_str</span>(<span class="kw-2">&</span><span class="ident">data</span>).<span class="ident">unwrap</span>();
|
||||
<span class="ident">pocket</span>
|
||||
}
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">panic</span><span class="macro">!</span>(<span class="string">"Can't load old RedisJSON RDB"</span>),
|
||||
};
|
||||
|
|
8
src/cache/utils.rs.html
vendored
8
src/cache/utils.rs.html
vendored
|
@ -77,7 +77,6 @@
|
|||
<span id="74">74</span>
|
||||
<span id="75">75</span>
|
||||
<span id="76">76</span>
|
||||
<span id="77">77</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="comment">/*
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
|
@ -97,8 +96,7 @@
|
|||
*/</span>
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">time</span>::{<span class="ident">SystemTime</span>, <span class="ident">UNIX_EPOCH</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="ident">redis_module</span>::<span class="ident">RedisError</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">errors</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
|
@ -123,10 +121,10 @@
|
|||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">inline</span>]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_pocket_instant</span>(<span class="ident">duration</span>: <span class="ident">u64</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">u64</span>, <span class="ident">RedisError</span><span class="op">></span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_pocket_instant</span>(<span class="ident">duration</span>: <span class="ident">u64</span>) <span class="op">-</span><span class="op">></span> <span class="ident">CacheResult</span><span class="op"><</span><span class="ident">u64</span><span class="op">></span> {
|
||||
<span class="kw">match</span> <span class="ident">SystemTime</span>::<span class="ident">now</span>().<span class="ident">duration_since</span>(<span class="ident">UNIX_EPOCH</span>) {
|
||||
<span class="prelude-val">Ok</span>(<span class="ident">val</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Ok</span>(<span class="ident">val</span>.<span class="ident">as_secs</span>() <span class="op">+</span> <span class="ident">duration</span>),
|
||||
<span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">RedisError</span>::<span class="ident">String</span>(<span class="string">"SystemTime before UNIX EPOCH!"</span>.<span class="ident">into</span>())),
|
||||
<span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=</span><span class="op">></span> <span class="prelude-val">Err</span>(<span class="ident">CacheError</span>::<span class="ident">new</span>(<span class="string">"SystemTime before UNIX EPOCH!"</span>.<span class="ident">into</span>())),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue