This commit is contained in:
nickray
2021-03-06 12:00:40 +00:00
parent 942ce83458
commit 71e1922031
256 changed files with 10177 additions and 279 deletions
+6
View File
@@ -0,0 +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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../cfg_if/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate cfg_if</p><div class="block version"><p>Version 1.0.0</p></div><a id="all-types" href="index.html"><p>Back to index</p></a></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span>
</span>
<span class="in-band">List of all items</span></h1><h3 id="Macros">Macros</h3><ul class="macros docblock"><li><a href="macro.cfg_if.html">cfg_if</a></li></ul></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "cfg_if";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
+25
View File
@@ -0,0 +1,25 @@
<!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 `cfg_if` crate."><meta name="keywords" content="rust, rustlang, rust-lang, cfg_if"><title>cfg_if - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../cfg_if/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate cfg_if</p><div class="block version"><p>Version 1.0.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all cfg_if's items</p></a><div class="block items"><ul><li><a href="#macros">Macros</a></li></ul></div><p class="location"></p><script>window.sidebarCurrent = {name: "cfg_if", ty: "mod", relpath: "../"};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/cfg_if/lib.rs.html#1-176" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">cfg_if</a></span></h1><div class="docblock"><p>A macro for defining <code>#[cfg]</code> if-else statements.</p>
<p>The macro provided by this crate, <code>cfg_if</code>, is similar to the <code>if/elif</code> C
preprocessor macro by allowing definition of a cascade of <code>#[cfg]</code> cases,
emitting the implementation which matches first.</p>
<p>This allows you to conveniently provide a long list <code>#[cfg]</code>'d blocks of code
without having to rewrite each clause multiple times.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="ident">cfg_if</span>::<span class="macro">cfg_if</span><span class="macro">!</span> {
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">unix</span>)]</span> {
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* unix specific functionality */</span> }
} <span class="kw">else</span> <span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_pointer_width</span> <span class="op">=</span> <span class="string">&quot;32&quot;</span>)]</span> {
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* non-unix, 32-bit functionality */</span> }
} <span class="kw">else</span> {
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* fallback implementation */</span> }
}
}
</pre></div>
</div><h2 id="macros" class="section-header"><a href="#macros">Macros</a></h2>
<table><tr class="module-item"><td><a class="macro" href="macro.cfg_if.html" title="cfg_if::cfg_if macro">cfg_if</a></td><td class="docblock-short"><p>The main macro provided by this crate. See crate documentation for more
information.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "cfg_if";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.cfg_if.html">
</head>
<body>
<p>Redirecting to <a href="macro.cfg_if.html">macro.cfg_if.html</a>...</p>
<script>location.replace("macro.cfg_if.html" + location.search + location.hash);</script>
</body>
</html>
+23
View File
@@ -0,0 +1,23 @@
<!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 `cfg_if` macro in crate `cfg_if`."><meta name="keywords" content="rust, rustlang, rust-lang, cfg_if"><title>cfg_if::cfg_if - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc macro"><!--[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">&#9776;</div><a href='../cfg_if/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">cfg_if</a></p><script>window.sidebarCurrent = {name: "cfg_if", ty: "macro", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/cfg_if/lib.rs.html#34-87" title="goto source code">[src]</a></span><span class="in-band">Macro <a href="index.html">cfg_if</a>::<wbr><a class="macro" href="">cfg_if</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><div class="example-wrap"><pre class="rust macro">
<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">cfg_if</span> {
($(
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">meta</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
) <span class="kw">else</span> <span class="op">*</span> <span class="kw">else</span> {
$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens2</span>:<span class="ident">tt</span>)<span class="op">*</span>
}) <span class="op">=</span><span class="op">&gt;</span> { ... };
(
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">i_met</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">i_tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
$(
<span class="kw">else</span> <span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">e_met</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">e_tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
)<span class="op">*</span>
) <span class="op">=</span><span class="op">&gt;</span> { ... };
(@<span class="ident">__items</span> ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">not</span>:<span class="ident">meta</span>,)<span class="kw-2">*</span>) ; ) <span class="op">=</span><span class="op">&gt;</span> { ... };
(@<span class="ident">__items</span> ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">not</span>:<span class="ident">meta</span>,)<span class="kw-2">*</span>) ; ( ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">m</span>:<span class="ident">meta</span>),<span class="kw-2">*</span>) ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) ), $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">rest</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) <span class="op">=</span><span class="op">&gt;</span> { ... };
(@<span class="ident">__identity</span> $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) <span class="op">=</span><span class="op">&gt;</span> { ... };
}</pre></div>
</div><div class="docblock"><p>The main macro provided by this crate. See crate documentation for more
information.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "cfg_if";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
+1
View File
@@ -0,0 +1 @@
initSidebarItems({"macro":[["cfg_if","The main macro provided by this crate. See crate documentation for more information."]]});
+6
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
View File
@@ -0,0 +1,8 @@
<!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 `dequeue` fn in crate `delog`."><meta name="keywords" content="rust, rustlang, rust-lang, dequeue"><title>delog::dequeue - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../delog/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">delog</a></p><script>window.sidebarCurrent = {name: "dequeue", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/delog/logger.rs.html#532-537" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">delog</a>::<wbr><a class="fn" href="">dequeue</a></span></h1><pre class="rust fn">pub unsafe fn dequeue(delogger: impl <a class="trait" href="../delog/trait.Delogger.html" title="trait delog::Delogger">Delogger</a>, buf: &amp;mut [u8]) -&gt; &amp;str</pre><div class="docblock"><p>The core &quot;read from circular buffer&quot; method. Marked unsafe to discourage use!</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Unfortunately exposed for all to see, as the <code>delog!</code> macro needs access to it to
implement the logger at call site. Hence marked as unsafe.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "delog";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
+8
View File
@@ -0,0 +1,8 @@
<!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 `enqueue` fn in crate `delog`."><meta name="keywords" content="rust, rustlang, rust-lang, enqueue"><title>delog::enqueue - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../delog/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">delog</a></p><script>window.sidebarCurrent = {name: "enqueue", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/delog/logger.rs.html#410-412" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">delog</a>::<wbr><a class="fn" href="">enqueue</a></span></h1><pre class="rust fn">pub unsafe fn enqueue(delogger: impl <a class="trait" href="../delog/trait.Delogger.html" title="trait delog::Delogger">Delogger</a>, record: &amp;<a class="struct" href="../delog/struct.Record.html" title="struct delog::Record">Record</a>&lt;'_&gt;)</pre><div class="docblock"><p>The core &quot;write to circular buffer&quot; method. Marked unsafe to discourage use!</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Unfortunately exposed for all to see, as the <code>delog!</code> macro needs access to it to
implement the logger at call site. Hence marked as unsafe.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "delog";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
+5
View File
@@ -0,0 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `logger` fn in crate `delog`."><meta name="keywords" content="rust, rustlang, rust-lang, logger"><title>delog::logger - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../delog/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">delog</a></p><script>window.sidebarCurrent = {name: "logger", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/delog/lib.rs.html#141-143" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">delog</a>::<wbr><a class="fn" href="">logger</a></span></h1><pre class="rust fn">pub fn logger() -&gt; &amp;'static mut <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;'static dyn <a class="trait" href="../delog/trait.TryLogWithStatistics.html" title="trait delog::TryLogWithStatistics">TryLogWithStatistics</a>&gt;</pre><div class="docblock"><p>Returns a reference to the logger (as <code>TryLogWithStatistics</code> implementation)</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "delog";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
+19
View File
@@ -0,0 +1,19 @@
<!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 `try_enqueue` fn in crate `delog`."><meta name="keywords" content="rust, rustlang, rust-lang, try_enqueue"><title>delog::try_enqueue - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../delog/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">delog</a></p><script>window.sidebarCurrent = {name: "try_enqueue", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/delog/logger.rs.html#433-524" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">delog</a>::<wbr><a class="fn" href="">try_enqueue</a></span></h1><pre class="rust fn">pub unsafe fn try_enqueue(<br>&nbsp;&nbsp;&nbsp;&nbsp;delogger: impl <a class="trait" href="../delog/trait.Delogger.html" title="trait delog::Delogger">Delogger</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;record: &amp;<a class="struct" href="../delog/struct.Record.html" title="struct delog::Record">Record</a>&lt;'_&gt;<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;(), ()&gt;</pre><div class="docblock"><p>The fallible &quot;write to circular buffer&quot; method. Marked unsafe to discourage use!</p>
<h1 id="safety" class="section-header"><a href="#safety">Safety</a></h1>
<p>Unfortunately exposed for all to see, as the <code>delog!</code> macro needs access to it to
implement the logger at call site. Hence marked as unsafe.</p>
<p>This implementation needs some HEAVY testing. It is unsound on PC, where the OS
can schedule threads in any manner, but assumed to be sound in ARM Cortex-M NVIC
situations, where interrupts are &quot;nested&quot;, in the sense that one may be interrupted,
then the interrupter can, ..., then the interrupter hands back control, ..., and finally
the original caller of this function regains control.</p>
<p>In this situation, we keep track of three counters <code>(read, written, claimed)</code>, with
invariants <code>read &lt;= written &lt;= claimed</code>. Each writer pessimistically gauges sufficient
capacity for its log by checking <code>claimed + size &lt;= read + capacity</code>, accounting for the
wraparound. If so, the writer <strong>atomically advances the claim counter</strong>, and starts copying
its data in this newly claimed space. At the end, it is the duty of the &quot;first&quot; caller
to advance the <code>written</code> counter to the correct state.</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "delog";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>
+29
View File
@@ -0,0 +1,29 @@
<!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 `HexStr` fn in crate `delog`."><meta name="keywords" content="rust, rustlang, rust-lang, HexStr"><title>delog::hex::HexStr - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../delog/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">delog</a>::<wbr><a href="index.html">hex</a></p><script>window.sidebarCurrent = {name: "HexStr", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/delog/hex.rs.html#187-189" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">delog</a>::<wbr><a href="index.html">hex</a>::<wbr><a class="fn" href="">HexStr</a></span></h1><pre class="rust fn">pub fn HexStr&lt;T:&nbsp;?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, U:&nbsp;<a class="trait" href="../../delog/hex/trait.Unsigned.html" title="trait delog::hex::Unsigned">Unsigned</a>, S:&nbsp;<a class="trait" href="../../delog/hex/trait.Separator.html" title="trait delog::hex::Separator">Separator</a>&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;value: &amp;T<br>) -&gt; <a class="struct" href="../../delog/hex/struct.HexStr.html" title="struct delog::hex::HexStr">HexStr</a>&lt;'_, T, U, S&gt;</pre><div class="docblock"><p>Explicitly construct a newtype to format with.</p>
<p>The first generic parameter specifies the block size in bytes, the second parameter
the separator string.</p>
<p>This function is just here for documentation of what the <code>hex_str!</code> macro
does internally (using the undocumented <code>typeint!</code> and <code>typesep!</code> macros).</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">delog</span>::<span class="ident">hex</span>::{<span class="ident">HexStr</span>, <span class="ident">Separator</span>, <span class="ident">Unsigned</span>};
<span class="comment">// typeint!(U3, 3);</span>
<span class="kw">struct</span> <span class="ident">U3</span> {}
<span class="kw">impl</span> <span class="ident">Unsigned</span> <span class="kw">for</span> <span class="ident">U3</span> {
<span class="kw">const</span> <span class="ident">N</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">3</span>;
}
<span class="comment">// typesep!(Pipe, &quot;|&quot;);</span>
<span class="kw">struct</span> <span class="ident">Pipe</span> {}
<span class="kw">impl</span> <span class="ident">Separator</span> <span class="kw">for</span> <span class="ident">Pipe</span> {
<span class="kw">const</span> <span class="ident">SEPARATOR</span>: <span class="kw-2">&amp;</span><span class="lifetime">&#39;static</span> <span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;|&quot;</span>;
}
<span class="kw">let</span> <span class="ident">four_bytes</span> <span class="op">=</span> <span class="kw-2">&amp;</span>[<span class="number">7u8</span>, <span class="number">0xA1</span>, <span class="number">255</span>, <span class="number">0xC7</span>];
<span class="kw">let</span> <span class="ident">hex_str</span> <span class="op">=</span> <span class="ident">HexStr</span>::<span class="op">&lt;</span><span class="kw">_</span>, <span class="ident">U3</span>, <span class="ident">Pipe</span><span class="op">&gt;</span>(<span class="ident">four_bytes</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">hex_str</span>), <span class="string">&quot;07A1FF|C7&quot;</span>);</pre></div>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "delog";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
+39
View File
@@ -0,0 +1,39 @@
<!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 `hex` mod in crate `delog`."><meta name="keywords" content="rust, rustlang, rust-lang, hex"><title>delog::hex - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../delog/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module hex</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../index.html">delog</a></p><script>window.sidebarCurrent = {name: "hex", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/delog/hex.rs.html#1-308" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">delog</a>::<wbr><a class="mod" href="">hex</a></span></h1><div class="docblock"><p>Convenient <code>Display</code> and other traits for binary data.</p>
<p>Standard Rust uses the <code>fmt::UpperHex</code> and <code>LowerHex</code> traits to implement hexadecimal
representations for use in format strings. For instance,
<code>format_args!(&quot;{:02X?}&quot;, &amp;[7, 0xA1, 0xFF])</code> produces the string <code>&quot;[07, A1, FF]&quot;</code>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:02X?}&quot;</span>, [<span class="number">7u8</span>, <span class="number">0xA1</span>, <span class="number">0xFF</span>].<span class="ident">as_ref</span>()), <span class="string">&quot;[07, A1, FF]&quot;</span>);</pre></div>
<p>However, this only works for the <code>Debug</code> trait, not <code>Display</code>; needs extra dancing
to pad with leading zeros, and is not very compact when debugging binary data formats.</p>
<p>The idea of this module is to generate newtypes around byte arrays/slices, and implement the <code>fmt</code> traits on these.
In release builds, this is all compiled out and translates to direct instructions for the formatting machinery.</p>
<p>The ide to implement truncated outputs comes from the <code>hex_fmt</code> library, which we refer to
for additional newtypes that can be used.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">delog</span>::{<span class="ident">hex_str</span>, <span class="ident">hexstr</span>};
<span class="kw">let</span> <span class="ident">data</span> <span class="op">=</span> <span class="kw-2">&amp;</span>[<span class="number">7u8</span>, <span class="number">0xA1</span>, <span class="number">255</span>, <span class="number">0xC7</span>];
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="macro">hexstr</span><span class="macro">!</span>(<span class="ident">data</span>)), <span class="string">&quot;07A1FFC7&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:x}&quot;</span>, <span class="macro">hexstr</span><span class="macro">!</span>(<span class="ident">data</span>)), <span class="string">&quot;07a1ffc7&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:2x}&quot;</span>, <span class="macro">hex_str</span><span class="macro">!</span>(<span class="ident">data</span>)), <span class="string">&quot;07..c7&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:&lt;3x}&quot;</span>, <span class="macro">hex_str</span><span class="macro">!</span>(<span class="ident">data</span>)), <span class="string">&quot;07 a1 ff..&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:&gt;3x}&quot;</span>, <span class="macro">hex_str</span><span class="macro">!</span>(<span class="ident">data</span>)), <span class="string">&quot;..a1 ff c7&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="macro">hex_str</span><span class="macro">!</span>(<span class="ident">data</span>, <span class="number">2</span>)), <span class="string">&quot;07A1 FFC7&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">&quot;{:&lt;3}&quot;</span>, <span class="macro">hex_str</span><span class="macro">!</span>(<span class="ident">data</span>, <span class="ident">sep</span>: <span class="string">&quot;|&quot;</span>)), <span class="string">&quot;07|A1|FF..&quot;</span>);</pre></div>
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.HexStr.html" title="delog::hex::HexStr struct">HexStr</a></td><td class="docblock-short"><p>Zero-sized wrapper newtype, allowing grouping bytes in blocks of N hexadecimals
during formatting.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.U1.html" title="delog::hex::U1 struct">U1</a></td><td class="docblock-short"><p>A type that represents the integer <code>1</code>.</p>
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
<table><tr class="module-item"><td><a class="trait" href="trait.Separator.html" title="delog::hex::Separator trait">Separator</a></td><td class="docblock-short"><p>A type that specifies a separator str.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.Unsigned.html" title="delog::hex::Unsigned trait">Unsigned</a></td><td class="docblock-short"><p>A type that specifies an unsigned integer.</p>
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.HexStr.html" title="delog::hex::HexStr fn">HexStr</a></td><td class="docblock-short"><p>Explicitly construct a newtype to format with.</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "delog";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
+1
View File
@@ -0,0 +1 @@
initSidebarItems({"fn":[["HexStr","Explicitly construct a newtype to format with."]],"struct":[["HexStr","Zero-sized wrapper newtype, allowing grouping bytes in blocks of N hexadecimals during formatting."],["U1","A type that represents the integer `1`."]],"trait":[["Separator","A type that specifies a separator str."],["Unsigned","A type that specifies an unsigned integer."]]});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
View File
@@ -0,0 +1,8 @@
<!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 `Separator` trait in crate `delog`."><meta name="keywords" content="rust, rustlang, rust-lang, Separator"><title>delog::hex::Separator - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[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">&#9776;</div><a href='../../delog/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait Separator</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.SEPARATOR">SEPARATOR</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="../index.html">delog</a>::<wbr><a href="index.html">hex</a></p><script>window.sidebarCurrent = {name: "Separator", ty: "trait", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/delog/hex.rs.html#79-82" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">delog</a>::<wbr><a href="index.html">hex</a>::<wbr><a class="trait" href="">Separator</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait Separator {
const <a href="#associatedconstant.SEPARATOR" class="constant"><b>SEPARATOR</b></a>: &amp;'static str;
}</pre></div><div class="docblock"><p>A type that specifies a separator str.</p>
</div><h2 id="associated-const" class="small-section-header">Associated Constants<a href="#associated-const" class="anchor"></a></h2><div class="methods"><h3 id="associatedconstant.SEPARATOR" class="method"><code>const <a href="#associatedconstant.SEPARATOR" class="constant"><b>SEPARATOR</b></a>: &amp;'static str</code><a class="srclink" href="../../src/delog/hex.rs.html#81" title="goto source code">[src]</a></h3><div class="docblock"><p>The actual separator str.</p>
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/delog/hex/trait.Separator.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "delog";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
+10
View File
@@ -0,0 +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="API documentation for the Rust `Unsigned` trait in crate `delog`."><meta name="keywords" content="rust, rustlang, rust-lang, Unsigned"><title>delog::hex::Unsigned - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[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">&#9776;</div><a href='../../delog/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Trait Unsigned</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-const">Associated Constants</a><div class="sidebar-links"><a href="#associatedconstant.N">N</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class="location"><a href="../index.html">delog</a>::<wbr><a href="index.html">hex</a></p><script>window.sidebarCurrent = {name: "Unsigned", ty: "trait", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/delog/hex.rs.html#48-51" title="goto source code">[src]</a></span><span class="in-band">Trait <a href="../index.html">delog</a>::<wbr><a href="index.html">hex</a>::<wbr><a class="trait" href="">Unsigned</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust trait">pub trait Unsigned {
const <a href="#associatedconstant.N" class="constant"><b>N</b></a>: usize;
}</pre></div><div class="docblock"><p>A type that specifies an unsigned integer.</p>
<p>We use this instead of <code>typenum</code> as the latter currently lacks
a mapping from <code>usize</code> to the associated type.</p>
</div><h2 id="associated-const" class="small-section-header">Associated Constants<a href="#associated-const" class="anchor"></a></h2><div class="methods"><h3 id="associatedconstant.N" class="method"><code>const <a href="#associatedconstant.N" class="constant"><b>N</b></a>: usize</code><a class="srclink" href="../../src/delog/hex.rs.html#50" title="goto source code">[src]</a></h3><div class="docblock"><p>The actual number.</p>
</div></div><span class="loading-content">Loading content...</span><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><h3 id="impl-Unsigned" class="impl"><code class="in-band">impl Unsigned for <a class="struct" href="../../delog/hex/struct.U1.html" title="struct delog::hex::U1">U1</a></code><a href="#impl-Unsigned" class="anchor"></a><a class="srclink" href="../../src/delog/hex.rs.html#68-70" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedconstant.N-1" class="associatedconstant hidden"><code>const <a href="#associatedconstant.N-1" class="constant"><b>N</b></a>: usize</code><a class="srclink" href="../../src/delog/hex.rs.html#69" title="goto source code">[src]</a></h4></div></div><span class="loading-content">Loading content...</span><script type="text/javascript" src="../../implementors/delog/hex/trait.Unsigned.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "delog";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
+121
View File
@@ -0,0 +1,121 @@
<!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 `delog` crate."><meta name="keywords" content="rust, rustlang, rust-lang, delog"><title>delog - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../delog/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate delog</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 delog's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#macros">Macros</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"></p><script>window.sidebarCurrent = {name: "delog", ty: "mod", relpath: "../"};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/delog/lib.rs.html#1-183" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">delog</a></span></h1><div class="docblock"><h1 id="compile-time-configurable-deferred-logging-for-printf-debugging-aka-tracing" class="section-header"><a href="#compile-time-configurable-deferred-logging-for-printf-debugging-aka-tracing">Compile-time configurable deferred logging (for <code>printf()</code>-debugging <em>aka</em> tracing)</a></h1>
<p>This is an implementation of the <code>log::Log</code> trait, suitable for use
in both embedded and desktop environments.</p>
<p>It has two main goals:</p>
<ul>
<li>logs are stored in a circular static memory buffer, so that logging is &quot;zero-cost in the inner
loop&quot; (apart from the formatting), with deferred actual I/O later via flushing.</li>
<li>compile-time log level settings for applications with multiple library components;
inactive log levels of libraries are completely compiled out.</li>
</ul>
<p>Moreover, setting the kill switch feature flag <code>knock-it-off</code>, any and all traces of logging
are removed from the final binary.</p>
<h2 id="usage-and-defaults" class="section-header"><a href="#usage-and-defaults">Usage and defaults</a></h2>
<blockquote>
<p><em>&quot;Global settings subtractive (default all), local settings additive (default none) but with kill-switch.&quot;</em></p>
</blockquote>
<p>From <code>log</code>, we inherit:</p>
<ul>
<li>static global filters, default <code>LevelFilter::Trace</code> (i.e., everything), set via <code>delog</code> or
<code>log</code> feature flags (multiple settings result in the most restrictive filter)</li>
<li>dynamic global filter, initialized in the &quot;init&quot;/&quot;init_default&quot; constructors of the
macro-generated structs implementing our <code>Delogger</code> trait. This can be changed by calls to
the global <code>set_max_level</code> function in <code>log</code>.</li>
</ul>
<p>Libraries that use the logging macros from <code>log</code> are governed by the more restrictive of these two settings.</p>
<p>On the other hand, a library that uses the <code>delog::generate_macros!()</code> macro gains macros <code>info!</code>, <code>warn!</code>, etc.,
which, by default, do nothing, and are completely optimized out.</p>
<p>If such a libray itself defines a feature <code>log-all</code> that is active, then logging calls with these macros are passed through
and goverend by the global filters. Such a library can also define a feature such as
<code>log-info</code>, which activates <em>exactly</em> the info-level logs; it is up to the library to define
logic such as &quot;log-info implies log-warn&quot;. There is a kill-switch: if the library defines a
feature <code>log-none</code>, and some intermediate library activates one of the additive <code>log-*</code>
features, setting <code>log-none</code> completely turns off logging for this library.</p>
<h2 id="background" class="section-header"><a href="#background">Background</a></h2>
<p>Compared to existing approaches such as <code>ufmt</code>, <code>cortex-m-funnel</code> and <code>defmt</code>,
we pursue different values and requirements, namely:</p>
<ul>
<li><strong>compatibility with the standard <code>core::fmt</code> traits and the standard <code>log</code> library API</strong>.
This means that, while libraries may &quot;upgrade&quot; their logging capabilities by using <code>delog</code>
as drop-in replacement for their logging calls (see below), any existing library that already
uses <code>log</code> is compatible. This, for our use cases, is a huge win, as opposed to using up &quot;weirdness
budget&quot; and requiring custom tooling for something that is often trivial, throw-away, simple logging.</li>
<li>it follows that one can easily drop a <code>trace!(&quot;{:?}&quot;, &amp;suspicious_object)</code> call at any time for
any object that has a (possibly automatically derived) <code>Debug</code> trait implementation without
passing around structures and keeping on top of lifetimes.</li>
<li>deferred logging: This is a typical &quot;shared memory&quot; logger, calls to <code>info!</code> etc.
are not directly sent to their final output, but instead are stored in a circular buffer
that is &quot;drained&quot; by calling <code>flush</code> on the logger at a convenient moment, for instance
in an idle loop.</li>
<li>immediate mode logging: Sometimes one wants to bypass the deferred flushing of logs,
this is possible using either the little-known <code>target</code> argument to <code>info!</code> and friends
with &quot;!&quot; as parameter, or using the additional <code>immediate_info!</code> and friends macros.</li>
<li>ability to set log levels <em>per library, at compile-time</em>. This can be easily retro-fitted
on existing <code>log</code>-based libraries, by adding the requisite features in <code>Cargo.toml</code> and
replacing <code>log</code> with <code>delog</code> (see <code>gate-tests</code> for examples of this).</li>
<li>the outcome is that one can leave useful logging calls in the library code, only to activate
them in targeted ways at build time, exactly as needed.</li>
<li>helper macros to easily output binary byte arrays and slices in hexadecimal representations,
which wrap the data in newtypes with custom <code>fmt::UpperHex</code> etc. implementations.</li>
</ul>
<p><strong>Non-goals</strong>:</p>
<ul>
<li>ultimate speed or code size: Our intention are &quot;normal&quot; logs, not the use of logging/tracing to
for stream binary data to the host. While admittedly the <code>core::fmt</code>-ing facilities are not as
efficient as one might hope, in our use cases we have sufficient flash and RAM to use these (and
some hope that, someday, eventually, maybe, the formatting machinery will be revisited and
improved at the root level, namely the language itself.)</li>
</ul>
<p>That said, we believe there is opportunity to extend <code>delog</code> in the <code>defmt</code> direction by
using, e.g., the <code>fmt::Binary</code> trait, newtypes and sentinel values to embed raw binary
representations of data in time-critical situations without formatting, deferring
the extraction and actual formatting to some host-side mechanism.</p>
<h2 id="features" class="section-header"><a href="#features">Features</a></h2>
<p>The <code>flushers</code> and <code>semihosting</code> features mostly exist to share code within the examples,
including the <code>example</code> feature. Without them, dependencies are quite minimal, and compilation fast.</p>
<p>The <code>fallible</code> and <code>immediate</code> features (default on) activate the <code>try_*!</code> and <code>*_now!</code> macros, respectively.</p>
<h2 id="warning" class="section-header"><a href="#warning">Warning</a></h2>
<p>The current circular buffer implementation (v0.1.0) is definitely unsound on desktop.
For embedded use, atomics are required (so no Cortex-M0/M1, and no plans to support non-atomic
platforms, which are likely to also be too resource-constrained to support the bloat inherent
in <code>core::fmt</code>). While we think the implemented circular buffer algorithm works for the &quot;nested interrupt&quot;
setup of NVICs, it has not been tested much.
The hope is that the worst case scenario is some slightly messed up log outputs.</p>
<h2 id="outlook" class="section-header"><a href="#outlook">Outlook</a></h2>
<p>We plan to iterate towards a v0.2.0 soon, making use of a separate &quot;flusher&quot; for the
&quot;immediate&quot; logging path. For instance, when logging via serial-over-USB, one might want immediate
logs to pend a separate RTIC interrupt handler that blocks until the logs are pushed and read
(allowing one to debug the boot process of a firmware), or one might want to just write to RTT
(or even semihosting xD) for these, during development.</p>
</div><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use <a class="mod" href="../log/index.html" title="mod log">log</a>;</code></td></tr></table><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
<table><tr class="module-item"><td><a class="mod" href="hex/index.html" title="delog::hex mod">hex</a></td><td class="docblock-short"><p>Convenient <code>Display</code> and other traits for binary data.</p>
</td></tr><tr class="module-item"><td><a class="mod" href="render/index.html" title="delog::render mod">render</a></td><td class="docblock-short"><p>The default, minimal renderer, and some helper functions.</p>
</td></tr></table><h2 id="macros" class="section-header"><a href="#macros">Macros</a></h2>
<table><tr class="module-item"><td><a class="macro" href="macro.delog.html" title="delog::delog macro">delog</a></td><td class="docblock-short"><p>Generate a deferred logger with specified capacity and flushing mechanism.</p>
</td></tr><tr class="module-item"><td><a class="macro" href="macro.generate_macros.html" title="delog::generate_macros macro">generate_macros</a></td><td class="docblock-short"><p>Generate logging macros that can be gated by library.</p>
</td></tr><tr class="module-item"><td><a class="macro" href="macro.hex_str.html" title="delog::hex_str macro">hex_str</a></td><td class="docblock-short"><p>Compactly format byte arrays and slices as hexadecimals.</p>
</td></tr><tr class="module-item"><td><a class="macro" href="macro.hexstr.html" title="delog::hexstr macro">hexstr</a></td><td class="docblock-short"><p>More compactly format byte arrays and slices as hexadecimals.</p>
</td></tr><tr class="module-item"><td><a class="macro" href="macro.try_log.html" title="delog::try_log macro">try_log</a></td><td class="docblock-short"><p>Fallible (ungated) version of <code>log!</code>.</p>
</td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.Record.html" title="delog::Record struct">Record</a></td><td class="docblock-short"><p>The &quot;payload&quot; of a log message.</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Statistics.html" title="delog::Statistics struct">Statistics</a></td><td class="docblock-short"><p>Statistics on logger usage.</p>
</td></tr></table><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<table><tr class="module-item"><td><a class="enum" href="enum.Level.html" title="delog::Level enum">Level</a></td><td class="docblock-short"><p>An enum representing the available verbosity levels of the logger.</p>
</td></tr><tr class="module-item"><td><a class="enum" href="enum.LevelFilter.html" title="delog::LevelFilter enum">LevelFilter</a></td><td class="docblock-short"><p>An enum representing the available verbosity level filters of the logger.</p>
</td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
<table><tr class="module-item"><td><a class="trait" href="trait.Delogger.html" title="delog::Delogger trait">Delogger</a></td><td class="docblock-short"><p>Semi-abstract characterization of the deferred loggers that the <code>delog!</code> macro produces.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.Flusher.html" title="delog::Flusher trait">Flusher</a></td><td class="docblock-short"><p>A way to pass on logs, user supplied.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.Renderer.html" title="delog::Renderer trait">Renderer</a></td><td class="docblock-short"><p>A way to format logs, user supplied.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.State.html" title="delog::State trait">State</a></td><td class="docblock-short"><p>Trait for either state or statistics of loggers.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.TryLog.html" title="delog::TryLog trait">TryLog</a></td><td class="docblock-short"><p>Fallible, panic-free version of the <code>log::Log</code> trait.</p>
</td></tr><tr class="module-item"><td><a class="trait" href="trait.TryLogWithStatistics.html" title="delog::TryLogWithStatistics trait">TryLogWithStatistics</a></td><td class="docblock-short"><p>TryLog with some usage statistics on top.</p>
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.dequeue.html" title="delog::dequeue fn">dequeue</a><a title="unsafe function" href="#"><sup></sup></a></td><td class="docblock-short"><p>The core &quot;read from circular buffer&quot; method. Marked unsafe to discourage use!</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.enqueue.html" title="delog::enqueue fn">enqueue</a><a title="unsafe function" href="#"><sup></sup></a></td><td class="docblock-short"><p>The core &quot;write to circular buffer&quot; method. Marked unsafe to discourage use!</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.logger.html" title="delog::logger fn">logger</a></td><td class="docblock-short"><p>Returns a reference to the logger (as <code>TryLogWithStatistics</code> implementation)</p>
</td></tr><tr class="module-item"><td><a class="fn" href="fn.try_enqueue.html" title="delog::try_enqueue fn">try_enqueue</a><a title="unsafe function" href="#"><sup></sup></a></td><td class="docblock-short"><p>The fallible &quot;write to circular buffer&quot; method. Marked unsafe to discourage use!</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "delog";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>

Some files were not shown because too many files have changed in this diff Show More