update docs for ci-workflow-stability
This commit is contained in:
parent
51edd0525b
commit
dc9b03c06d
File diff suppressed because it is too large
Load Diff
|
@ -1,52 +1,103 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!-- This file is generated by Nim. -->
|
||||
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>libp2p/utility</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
|
||||
|
||||
<!-- Google fonts -->
|
||||
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
|
||||
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
|
||||
|
||||
<!-- CSS -->
|
||||
<title>libp2p/utility</title>
|
||||
<link rel="stylesheet" type="text/css" href="../nimdoc.out.css">
|
||||
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="../dochack.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function main() {
|
||||
var pragmaDots = document.getElementsByClassName("pragmadots");
|
||||
for (var i = 0; i < pragmaDots.length; i++) {
|
||||
pragmaDots[i].onclick = function(event) {
|
||||
// Hide tease
|
||||
event.target.parentNode.style.display = "none";
|
||||
// Show actual
|
||||
event.target.parentNode.nextElementSibling.style.display = "inline";
|
||||
}
|
||||
}
|
||||
|
||||
function switchTheme(e) {
|
||||
if (e.target.checked) {
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
localStorage.setItem('theme', 'dark');
|
||||
} else {
|
||||
document.documentElement.setAttribute('data-theme', 'light');
|
||||
localStorage.setItem('theme', 'light');
|
||||
}
|
||||
}
|
||||
|
||||
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
|
||||
if (toggleSwitch !== null) {
|
||||
toggleSwitch.addEventListener('change', switchTheme, false);
|
||||
}
|
||||
|
||||
var currentTheme = localStorage.getItem('theme');
|
||||
if (!currentTheme && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
currentTheme = 'dark';
|
||||
}
|
||||
if (currentTheme) {
|
||||
document.documentElement.setAttribute('data-theme', currentTheme);
|
||||
|
||||
if (currentTheme === 'dark' && toggleSwitch !== null) {
|
||||
toggleSwitch.checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', main);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="documentId">
|
||||
<div class="container">
|
||||
<h1 class="title">libp2p/utility</h1>
|
||||
<div class="row">
|
||||
<div class="document" id="documentId">
|
||||
<div class="container">
|
||||
<h1 class="title">libp2p/utility</h1>
|
||||
<div class="row">
|
||||
<div class="three columns">
|
||||
<div class="theme-select-wrapper">
|
||||
<label for="theme-select">Theme: </label>
|
||||
<select id="theme-select" onchange="setTheme(this.value)">
|
||||
<option value="auto">🌗 Match OS</option>
|
||||
<option value="dark">🌑 Dark</option>
|
||||
<option value="light">🌕 Light</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="global-links">
|
||||
<ul class="simple">
|
||||
<li><a id="indexLink" href="../theindex.html">Index</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchInputDiv">
|
||||
Search: <input type="search" id="searchInput" onkeyup="search()"/>
|
||||
</div>
|
||||
<div>
|
||||
Group by:
|
||||
<select onchange="groupBy(this.value)">
|
||||
<option value="section">Section</option>
|
||||
<option value="type">Type</option>
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
<div class="theme-switch-wrapper">
|
||||
<label class="theme-switch" for="checkbox">
|
||||
<input type="checkbox" id="checkbox" />
|
||||
<div class="slider round"></div>
|
||||
</label>
|
||||
<em>Dark Mode</em>
|
||||
</div>
|
||||
<div id="global-links">
|
||||
<ul class="simple">
|
||||
<li>
|
||||
<a href="../theindex.html">Index</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchInputDiv">
|
||||
Search: <input type="text" id="searchInput"
|
||||
onkeyup="search()" />
|
||||
</div>
|
||||
<div>
|
||||
Group by:
|
||||
<select onchange="groupBy(this.value)">
|
||||
<option value="section">Section</option>
|
||||
<option value="type">Type</option>
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function main2() {
|
||||
// Create the slider
|
||||
var firstSlider = document.getElementsByClassName("theme-switch-wrapper")[0];
|
||||
|
@ -146,254 +197,249 @@ window.addEventListener("DOMContentLoaded", main2);
|
|||
</script>
|
||||
<ul class="simple simple-toc" id="toc-list">
|
||||
<li>
|
||||
<details open>
|
||||
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
|
||||
<ul class="simple simple-toc-section">
|
||||
<a class="reference reference-toplevel" href="#12" id="62">Procs</a>
|
||||
<ul class="simple simple-toc-section">
|
||||
<ul class="simple nested-toc-section">capLen
|
||||
<li><a class="reference" href="#capLen%2Cseq%5BT%5D%2CNatural" title="capLen[T](s: var seq[T]; length: Natural)">capLen[T](s: var seq[T]; length: Natural)</a></li>
|
||||
<li><a class="reference" href="#capLen%2Cseq%5BT%5D%2CNatural"
|
||||
title="capLen[T](s: var seq[T]; length: Natural)">capLen[T](s: var seq[T]; length: Natural)</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">shortLog
|
||||
<li><a class="reference" href="#shortLog%2CopenArray%5Bbyte%5D" title="shortLog(item: openArray[byte]): string">shortLog(item: openArray[byte]): string</a></li>
|
||||
<li><a class="reference" href="#shortLog%2Cstring" title="shortLog(item: string): string">shortLog(item: string): string</a></li>
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">shortLog
|
||||
<li><a class="reference" href="#shortLog%2CopenArray%5Bbyte%5D"
|
||||
title="shortLog(item: openArray[byte]): string">shortLog(item: openArray[byte]): string</a></li>
|
||||
<li><a class="reference" href="#shortLog%2Cstring"
|
||||
title="shortLog(item: string): string">shortLog(item: string): string</a></li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</details>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<details open>
|
||||
<summary><a class="reference reference-toplevel" href="#17" id="67">Macros</a></summary>
|
||||
<ul class="simple simple-toc-section">
|
||||
<a class="reference reference-toplevel" href="#17" id="67">Macros</a>
|
||||
<ul class="simple simple-toc-section">
|
||||
<ul class="simple nested-toc-section">withValue
|
||||
<li><a class="reference" href="#withValue.m%2C%2Cuntyped%2Cuntyped%2Cuntyped" title="withValue[T](self: Opt[T] | Option[T]; value, body, body2: untyped): untyped">withValue[T](self: Opt[T] | Option[T]; value, body, body2: untyped): untyped</a></li>
|
||||
<li><a class="reference" href="#withValue.m%2C%2Cuntyped%2Cuntyped%2Cuntyped"
|
||||
title="withValue[T](self: Opt[T] | Option[T]; value, body, body2: untyped): untyped">withValue[T](self: Opt[T] | Option[T]; value, body, body2: untyped): untyped</a></li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</details>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<details open>
|
||||
<summary><a class="reference reference-toplevel" href="#18" id="68">Templates</a></summary>
|
||||
<ul class="simple simple-toc-section">
|
||||
<a class="reference reference-toplevel" href="#18" id="68">Templates</a>
|
||||
<ul class="simple simple-toc-section">
|
||||
<ul class="simple nested-toc-section">compilesOr
|
||||
<li><a class="reference" href="#compilesOr.t%2Cuntyped%2Cuntyped" title="compilesOr(a, b: untyped): untyped">compilesOr(a, b: untyped): untyped</a></li>
|
||||
<li><a class="reference" href="#compilesOr.t%2Cuntyped%2Cuntyped"
|
||||
title="compilesOr(a, b: untyped): untyped">compilesOr(a, b: untyped): untyped</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">exceptionToAssert
|
||||
<li><a class="reference" href="#exceptionToAssert.t%2Cuntyped" title="exceptionToAssert(body: untyped): untyped">exceptionToAssert(body: untyped): untyped</a></li>
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">exceptionToAssert
|
||||
<li><a class="reference" href="#exceptionToAssert.t%2Cuntyped"
|
||||
title="exceptionToAssert(body: untyped): untyped">exceptionToAssert(body: untyped): untyped</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">public
|
||||
<li><a class="reference" href="#public.t" title="public()">public()</a></li>
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">public
|
||||
<li><a class="reference" href="#public.t"
|
||||
title="public()">public()</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">safeConvert
|
||||
<li><a class="reference" href="#safeConvert.t%2CS" title="safeConvert[T: SomeInteger; S: Ordinal](value: S): T">safeConvert[T: SomeInteger; S: Ordinal](value: S): T</a></li>
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">safeConvert
|
||||
<li><a class="reference" href="#safeConvert.t%2CS"
|
||||
title="safeConvert[T: SomeInteger; S: Ordinal](value: S): T">safeConvert[T: SomeInteger; S: Ordinal](value: S): T</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">toOpt
|
||||
<li><a class="reference" href="#toOpt.t%2CResult%5BT%2CE%5D" title="toOpt[T, E](self: Result[T, E]): Opt[T]">toOpt[T, E](self: Result[T, E]): Opt[T]</a></li>
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">toOpt
|
||||
<li><a class="reference" href="#toOpt.t%2CResult%5BT%2CE%5D"
|
||||
title="toOpt[T, E](self: Result[T, E]): Opt[T]">toOpt[T, E](self: Result[T, E]): Opt[T]</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">valueOr
|
||||
<li><a class="reference" href="#valueOr.t%2COption%5BT%5D%2Cuntyped" title="valueOr[T](self: Option[T]; body: untyped): untyped">valueOr[T](self: Option[T]; body: untyped): untyped</a></li>
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">valueOr
|
||||
<li><a class="reference" href="#valueOr.t%2COption%5BT%5D%2Cuntyped"
|
||||
title="valueOr[T](self: Option[T]; body: untyped): untyped">valueOr[T](self: Option[T]; body: untyped): untyped</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">withValue
|
||||
<li><a class="reference" href="#withValue.t%2C%2Cuntyped%2Cuntyped" title="withValue[T](self: Opt[T] | Option[T]; value, body: untyped): untyped">withValue[T](self: Opt[T] | Option[T]; value, body: untyped): untyped</a></li>
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">withValue
|
||||
<li><a class="reference" href="#withValue.t%2C%2Cuntyped%2Cuntyped"
|
||||
title="withValue[T](self: Opt[T] | Option[T]; value, body: untyped): untyped">withValue[T](self: Opt[T] | Option[T]; value, body: untyped): untyped</a></li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</details>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="nine columns" id="content">
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L1" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L1"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
<div id="tocRoot"></div>
|
||||
|
||||
<p class="module-desc"></p>
|
||||
<div class="section" id="12">
|
||||
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
||||
<dl class="item">
|
||||
<div id="capLen-procs-all">
|
||||
<div id="capLen,seq[T],Natural" class="tohide">
|
||||
<div class="nine columns" id="content">
|
||||
<div id="tocRoot"></div>
|
||||
|
||||
<p class="module-desc"></p>
|
||||
<div class="section" id="12">
|
||||
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
||||
<dl class="item">
|
||||
<div id="capLen,seq[T],Natural" class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#capLen%2Cseq%5BT%5D%2CNatural"><span class="Identifier">capLen</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">length</span><span class="Other">:</span> <span class="Identifier">Natural</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L73" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L73" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L73"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L73" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="shortLog-procs-all">
|
||||
<div id="shortLog,openArray[byte]" class="tohide">
|
||||
<dt><pre><span class="Keyword">func</span> <a href="#shortLog%2CopenArray%5Bbyte%5D"><span class="Identifier">shortLog</span></a><span class="Other">(</span><span class="Identifier">item</span><span class="Other">:</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<div id="shortLog,openArray[byte]" class="tohide">
|
||||
<dt><pre><span class="Keyword">func</span> <a href="#shortLog%2CopenArray%5Bbyte%5D"><span class="Identifier">shortLog</span></a><span class="Other">(</span><span class="Identifier">item</span><span class="Other">:</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L28" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L28" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L28"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L28" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
<div id="shortLog,string" class="tohide">
|
||||
<dt><pre><span class="Keyword">func</span> <a href="#shortLog%2Cstring"><span class="Identifier">shortLog</span></a><span class="Other">(</span><span class="Identifier">item</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dt><pre><span class="Keyword">func</span> <a href="#shortLog%2Cstring"><span class="Identifier">shortLog</span></a><span class="Other">(</span><span class="Identifier">item</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L40" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L40" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L40"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L40" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
</dl></div>
|
||||
<div class="section" id="17">
|
||||
<h1><a class="toc-backref" href="#17">Macros</a></h1>
|
||||
<dl class="item">
|
||||
<div id="withValue-macros-all">
|
||||
<div id="withValue.m,,untyped,untyped,untyped" class="tohide">
|
||||
<h1><a class="toc-backref" href="#17">Macros</a></h1>
|
||||
<dl class="item">
|
||||
<div id="withValue.m,,untyped,untyped,untyped" class="tohide">
|
||||
<dt><pre><span class="Keyword">macro</span> <a href="#withValue.m%2C%2Cuntyped%2Cuntyped%2Cuntyped"><span class="Identifier">withValue</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <span class="Identifier">Opt</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span> <span class="Operator">|</span> <span class="Identifier">Option</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">,</span> <span class="Identifier">body</span><span class="Other">,</span> <span class="Identifier">body2</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span> {.
|
||||
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L96" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L96" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L96"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L96" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
</dl></div>
|
||||
<div class="section" id="18">
|
||||
<h1><a class="toc-backref" href="#18">Templates</a></h1>
|
||||
<dl class="item">
|
||||
<div id="compilesOr-templates-all">
|
||||
<div id="compilesOr.t,untyped,untyped" class="tohide">
|
||||
<h1><a class="toc-backref" href="#18">Templates</a></h1>
|
||||
<dl class="item">
|
||||
<div id="compilesOr.t,untyped,untyped" class="tohide">
|
||||
<dt><pre><span class="Keyword">template</span> <a href="#compilesOr.t%2Cuntyped%2Cuntyped"><span class="Identifier">compilesOr</span></a><span class="Other">(</span><span class="Identifier">a</span><span class="Other">,</span> <span class="Identifier">b</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L22" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L22" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L22"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L22" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="exceptionToAssert-templates-all">
|
||||
<div id="exceptionToAssert.t,untyped" class="tohide">
|
||||
<div id="exceptionToAssert.t,untyped" class="tohide">
|
||||
<dt><pre><span class="Keyword">template</span> <a href="#exceptionToAssert.t%2Cuntyped"><span class="Identifier">exceptionToAssert</span></a><span class="Other">(</span><span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L77" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L77" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L77"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L77" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="public-templates-all">
|
||||
<div id="public.t" class="tohide">
|
||||
<div id="public.t" class="tohide">
|
||||
<dt><pre><span class="Keyword">template</span> <a href="#public.t"><span class="Identifier">public</span></a><span class="Other">(</span><span class="Other">)</span> {.<span class="Identifier">pragma</span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L17" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L17" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L17"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L17" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="safeConvert-templates-all">
|
||||
<div id="safeConvert.t,S" class="tohide">
|
||||
<div id="safeConvert.t,S" class="tohide">
|
||||
<dt><pre><span class="Keyword">template</span> <a href="#safeConvert.t%2CS"><span class="Identifier">safeConvert</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <span class="Identifier">SomeInteger</span><span class="Other">;</span> <span class="Identifier">S</span><span class="Other">:</span> <span class="Identifier">Ordinal</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">S</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
Converts <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt> from S to <tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt> iff <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span></span></tt> is guaranteed to be preserved.
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L66" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L66" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L66"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L66" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="toOpt-templates-all">
|
||||
<div id="toOpt.t,Result[T,E]" class="tohide">
|
||||
<div id="toOpt.t,Result[T,E]" class="tohide">
|
||||
<dt><pre><span class="Keyword">template</span> <a href="#toOpt.t%2CResult%5BT%2CE%5D"><span class="Identifier">toOpt</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">,</span> <span class="Identifier">E</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">,</span> <span class="Identifier">E</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Opt</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L111" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L111" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L111"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L111" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="valueOr-templates-all">
|
||||
<div id="valueOr.t,Option[T],untyped" class="tohide">
|
||||
<div id="valueOr.t,Option[T],untyped" class="tohide">
|
||||
<dt><pre><span class="Keyword">template</span> <a href="#valueOr.t%2COption%5BT%5D%2Cuntyped"><span class="Identifier">valueOr</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <span class="Identifier">Option</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L105" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L105" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L105"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L105" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="withValue-templates-all">
|
||||
<div id="withValue.t,,untyped,untyped" class="tohide">
|
||||
<div id="withValue.t,,untyped,untyped" class="tohide">
|
||||
<dt><pre><span class="Keyword">template</span> <a href="#withValue.t%2C%2Cuntyped%2Cuntyped"><span class="Identifier">withValue</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <span class="Identifier">Opt</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span> <span class="Operator">|</span> <span class="Identifier">Option</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">,</span> <span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L91" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L91" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/utility.nim#L91"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/utility.nim#L91" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
</dl></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve-columns footer">
|
||||
<span class="nim-sprite"></span>
|
||||
<br>
|
||||
<small style="color: var(--hint);">Made with Nim. Generated: 2023-12-13 12:51:13 UTC</small>
|
||||
<br/>
|
||||
<small style="color: var(--hint);">Made with Nim. Generated: 2023-12-13 15:37:15 UTC</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Google fonts -->
|
||||
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
|
||||
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,52 +1,103 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<!-- This file is generated by Nim. -->
|
||||
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>libp2p/varint</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
|
||||
|
||||
<!-- Google fonts -->
|
||||
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
|
||||
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
|
||||
|
||||
<!-- CSS -->
|
||||
<title>libp2p/varint</title>
|
||||
<link rel="stylesheet" type="text/css" href="../nimdoc.out.css">
|
||||
|
||||
<!-- JS -->
|
||||
<script type="text/javascript" src="../dochack.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function main() {
|
||||
var pragmaDots = document.getElementsByClassName("pragmadots");
|
||||
for (var i = 0; i < pragmaDots.length; i++) {
|
||||
pragmaDots[i].onclick = function(event) {
|
||||
// Hide tease
|
||||
event.target.parentNode.style.display = "none";
|
||||
// Show actual
|
||||
event.target.parentNode.nextElementSibling.style.display = "inline";
|
||||
}
|
||||
}
|
||||
|
||||
function switchTheme(e) {
|
||||
if (e.target.checked) {
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
localStorage.setItem('theme', 'dark');
|
||||
} else {
|
||||
document.documentElement.setAttribute('data-theme', 'light');
|
||||
localStorage.setItem('theme', 'light');
|
||||
}
|
||||
}
|
||||
|
||||
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
|
||||
if (toggleSwitch !== null) {
|
||||
toggleSwitch.addEventListener('change', switchTheme, false);
|
||||
}
|
||||
|
||||
var currentTheme = localStorage.getItem('theme');
|
||||
if (!currentTheme && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
currentTheme = 'dark';
|
||||
}
|
||||
if (currentTheme) {
|
||||
document.documentElement.setAttribute('data-theme', currentTheme);
|
||||
|
||||
if (currentTheme === 'dark' && toggleSwitch !== null) {
|
||||
toggleSwitch.checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', main);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="documentId">
|
||||
<div class="container">
|
||||
<h1 class="title">libp2p/varint</h1>
|
||||
<div class="row">
|
||||
<div class="document" id="documentId">
|
||||
<div class="container">
|
||||
<h1 class="title">libp2p/varint</h1>
|
||||
<div class="row">
|
||||
<div class="three columns">
|
||||
<div class="theme-select-wrapper">
|
||||
<label for="theme-select">Theme: </label>
|
||||
<select id="theme-select" onchange="setTheme(this.value)">
|
||||
<option value="auto">🌗 Match OS</option>
|
||||
<option value="dark">🌑 Dark</option>
|
||||
<option value="light">🌕 Light</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="global-links">
|
||||
<ul class="simple">
|
||||
<li><a id="indexLink" href="../theindex.html">Index</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchInputDiv">
|
||||
Search: <input type="search" id="searchInput" onkeyup="search()"/>
|
||||
</div>
|
||||
<div>
|
||||
Group by:
|
||||
<select onchange="groupBy(this.value)">
|
||||
<option value="section">Section</option>
|
||||
<option value="type">Type</option>
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
<div class="theme-switch-wrapper">
|
||||
<label class="theme-switch" for="checkbox">
|
||||
<input type="checkbox" id="checkbox" />
|
||||
<div class="slider round"></div>
|
||||
</label>
|
||||
<em>Dark Mode</em>
|
||||
</div>
|
||||
<div id="global-links">
|
||||
<ul class="simple">
|
||||
<li>
|
||||
<a href="../theindex.html">Index</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="searchInputDiv">
|
||||
Search: <input type="text" id="searchInput"
|
||||
onkeyup="search()" />
|
||||
</div>
|
||||
<div>
|
||||
Group by:
|
||||
<select onchange="groupBy(this.value)">
|
||||
<option value="section">Section</option>
|
||||
<option value="type">Type</option>
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function main2() {
|
||||
// Create the slider
|
||||
var firstSlider = document.getElementsByClassName("theme-switch-wrapper")[0];
|
||||
|
@ -146,123 +197,149 @@ window.addEventListener("DOMContentLoaded", main2);
|
|||
</script>
|
||||
<ul class="simple simple-toc" id="toc-list">
|
||||
<li>
|
||||
<details open>
|
||||
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
|
||||
<ul class="simple simple-toc-section">
|
||||
<li><a class="reference" href="#hint" title="hint = distinct int">hint</a></li>
|
||||
<li><a class="reference" href="#hint32" title="hint32 = distinct int32">hint32</a></li>
|
||||
<li><a class="reference" href="#hint64" title="hint64 = distinct int64">hint64</a></li>
|
||||
<li><a class="reference" href="#LP" title="LP = object">LP</a></li>
|
||||
<li><a class="reference" href="#LPSomeUVarint" title="LPSomeUVarint = uint | uint64 | uint32 | uint16 | uint8">LPSomeUVarint</a></li>
|
||||
<li><a class="reference" href="#LPSomeVarint" title="LPSomeVarint = LPSomeUVarint">LPSomeVarint</a></li>
|
||||
<li><a class="reference" href="#PB" title="PB = object">PB</a></li>
|
||||
<li><a class="reference" href="#PBSomeSVarint" title="PBSomeSVarint = hint | hint64 | hint32">PBSomeSVarint</a></li>
|
||||
<li><a class="reference" href="#PBSomeUVarint" title="PBSomeUVarint = uint | uint64 | uint32">PBSomeUVarint</a></li>
|
||||
<li><a class="reference" href="#PBSomeVarint" title="PBSomeVarint = PBSomeUVarint | PBSomeSVarint | PBZigVarint">PBSomeVarint</a></li>
|
||||
<li><a class="reference" href="#PBZigVarint" title="PBZigVarint = zint | zint64 | zint32">PBZigVarint</a></li>
|
||||
<li><a class="reference" href="#SomeUVarint" title="SomeUVarint = PBSomeUVarint | LPSomeUVarint">SomeUVarint</a></li>
|
||||
<li><a class="reference" href="#SomeVarint" title="SomeVarint = PBSomeVarint | LPSomeVarint">SomeVarint</a></li>
|
||||
<li><a class="reference" href="#VarintError" title="VarintError {.pure.} = enum
|
||||
<a class="reference reference-toplevel" href="#7" id="57">Types</a>
|
||||
<ul class="simple simple-toc-section">
|
||||
<li><a class="reference" href="#hint"
|
||||
title="hint = distinct int">hint</a></li>
|
||||
<li><a class="reference" href="#hint32"
|
||||
title="hint32 = distinct int32">hint32</a></li>
|
||||
<li><a class="reference" href="#hint64"
|
||||
title="hint64 = distinct int64">hint64</a></li>
|
||||
<li><a class="reference" href="#LP"
|
||||
title="LP = object">LP</a></li>
|
||||
<li><a class="reference" href="#LPSomeUVarint"
|
||||
title="LPSomeUVarint = uint | uint64 | uint32 | uint16 | uint8">LPSomeUVarint</a></li>
|
||||
<li><a class="reference" href="#LPSomeVarint"
|
||||
title="LPSomeVarint = LPSomeUVarint">LPSomeVarint</a></li>
|
||||
<li><a class="reference" href="#PB"
|
||||
title="PB = object">PB</a></li>
|
||||
<li><a class="reference" href="#PBSomeSVarint"
|
||||
title="PBSomeSVarint = hint | hint64 | hint32">PBSomeSVarint</a></li>
|
||||
<li><a class="reference" href="#PBSomeUVarint"
|
||||
title="PBSomeUVarint = uint | uint64 | uint32">PBSomeUVarint</a></li>
|
||||
<li><a class="reference" href="#PBSomeVarint"
|
||||
title="PBSomeVarint = PBSomeUVarint | PBSomeSVarint | PBZigVarint">PBSomeVarint</a></li>
|
||||
<li><a class="reference" href="#PBZigVarint"
|
||||
title="PBZigVarint = zint | zint64 | zint32">PBZigVarint</a></li>
|
||||
<li><a class="reference" href="#SomeUVarint"
|
||||
title="SomeUVarint = PBSomeUVarint | LPSomeUVarint">SomeUVarint</a></li>
|
||||
<li><a class="reference" href="#SomeVarint"
|
||||
title="SomeVarint = PBSomeVarint | LPSomeVarint">SomeVarint</a></li>
|
||||
<li><a class="reference" href="#VarintError"
|
||||
title="VarintError {.pure.} = enum
|
||||
Error, Overflow, Incomplete, Overlong, Overrun">VarintError</a></li>
|
||||
<li><a class="reference" href="#VarintResult" title="VarintResult[T] = Result[T, VarintError]">VarintResult</a></li>
|
||||
<li><a class="reference" href="#zint" title="zint = distinct int">zint</a></li>
|
||||
<li><a class="reference" href="#zint32" title="zint32 = distinct int32">zint32</a></li>
|
||||
<li><a class="reference" href="#zint64" title="zint64 = distinct int64">zint64</a></li>
|
||||
<li><a class="reference" href="#VarintResult"
|
||||
title="VarintResult[T] = Result[T, VarintError]">VarintResult</a></li>
|
||||
<li><a class="reference" href="#zint"
|
||||
title="zint = distinct int">zint</a></li>
|
||||
<li><a class="reference" href="#zint32"
|
||||
title="zint32 = distinct int32">zint32</a></li>
|
||||
<li><a class="reference" href="#zint64"
|
||||
title="zint64 = distinct int64">zint64</a></li>
|
||||
|
||||
</ul>
|
||||
</details>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<details open>
|
||||
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
|
||||
<ul class="simple simple-toc-section">
|
||||
<a class="reference reference-toplevel" href="#12" id="62">Procs</a>
|
||||
<ul class="simple simple-toc-section">
|
||||
<ul class="simple nested-toc-section">encodeVarint
|
||||
<li><a class="reference" href="#encodeVarint%2Ctypedesc%5BLP%5D%2CLPSomeVarint" title="encodeVarint(vtype: typedesc[LP]; value: LPSomeVarint): VarintResult[seq[byte]]">encodeVarint(vtype: typedesc[LP]; value: LPSomeVarint): VarintResult[seq[byte]]</a></li>
|
||||
<li><a class="reference" href="#encodeVarint%2Ctypedesc%5BPB%5D%2CPBSomeVarint" title="encodeVarint(vtype: typedesc[PB]; value: PBSomeVarint): VarintResult[seq[byte]]">encodeVarint(vtype: typedesc[PB]; value: PBSomeVarint): VarintResult[seq[byte]]</a></li>
|
||||
<li><a class="reference" href="#encodeVarint%2Ctypedesc%5BLP%5D%2CLPSomeVarint"
|
||||
title="encodeVarint(vtype: typedesc[LP]; value: LPSomeVarint): VarintResult[seq[byte]]">encodeVarint(vtype: typedesc[LP]; value: LPSomeVarint): VarintResult[seq[byte]]</a></li>
|
||||
<li><a class="reference" href="#encodeVarint%2Ctypedesc%5BPB%5D%2CPBSomeVarint"
|
||||
title="encodeVarint(vtype: typedesc[PB]; value: PBSomeVarint): VarintResult[seq[byte]]">encodeVarint(vtype: typedesc[PB]; value: PBSomeVarint): VarintResult[seq[byte]]</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">getSVarint
|
||||
<li><a class="reference" href="#getSVarint%2CopenArray%5Bbyte%5D%2Cint%2C" title="getSVarint(pbytes: openArray[byte]; outsize: var int;
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">getSVarint
|
||||
<li><a class="reference" href="#getSVarint%2CopenArray%5Bbyte%5D%2Cint%2C"
|
||||
title="getSVarint(pbytes: openArray[byte]; outsize: var int;
|
||||
outval: var (PBZigVarint | PBSomeSVarint)): VarintResult[void]">getSVarint(pbytes: openArray[byte]; outsize: var int;
|
||||
outval: var (PBZigVarint | PBSomeSVarint)): VarintResult[void]</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">getUVarint
|
||||
<li><a class="reference" href="#getUVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeUVarint" title="getUVarint[T: PB | LP](vtype: typedesc[T]; pbytes: openArray[byte];
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">getUVarint
|
||||
<li><a class="reference" href="#getUVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeUVarint"
|
||||
title="getUVarint[T: PB | LP](vtype: typedesc[T]; pbytes: openArray[byte];
|
||||
outlen: var int; outval: var SomeUVarint): VarintResult[
|
||||
void]">getUVarint[T: PB | LP](vtype: typedesc[T]; pbytes: openArray[byte];
|
||||
outlen: var int; outval: var SomeUVarint): VarintResult[
|
||||
void]</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">getVarint
|
||||
<li><a class="reference" href="#getVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeVarint" title="getVarint[T: PB | LP](vtype: typedesc[T]; pbytes: openArray[byte];
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">getVarint
|
||||
<li><a class="reference" href="#getVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeVarint"
|
||||
title="getVarint[T: PB | LP](vtype: typedesc[T]; pbytes: openArray[byte];
|
||||
nbytes: var int; value: var SomeVarint): VarintResult[void]">getVarint[T: PB | LP](vtype: typedesc[T]; pbytes: openArray[byte];
|
||||
nbytes: var int; value: var SomeVarint): VarintResult[void]</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">putSVarint
|
||||
<li><a class="reference" href="#putSVarint%2CopenArray%5Bbyte%5D%2Cint%2C" title="putSVarint(pbytes: var openArray[byte]; outsize: var int;
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">putSVarint
|
||||
<li><a class="reference" href="#putSVarint%2CopenArray%5Bbyte%5D%2Cint%2C"
|
||||
title="putSVarint(pbytes: var openArray[byte]; outsize: var int;
|
||||
outval: (PBZigVarint | PBSomeSVarint)): VarintResult[void]">putSVarint(pbytes: var openArray[byte]; outsize: var int;
|
||||
outval: (PBZigVarint | PBSomeSVarint)): VarintResult[void]</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">putUVarint
|
||||
<li><a class="reference" href="#putUVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeUVarint" title="putUVarint[T: PB | LP](vtype: typedesc[T]; pbytes: var openArray[byte];
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">putUVarint
|
||||
<li><a class="reference" href="#putUVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeUVarint"
|
||||
title="putUVarint[T: PB | LP](vtype: typedesc[T]; pbytes: var openArray[byte];
|
||||
outlen: var int; outval: SomeUVarint): VarintResult[void]">putUVarint[T: PB | LP](vtype: typedesc[T]; pbytes: var openArray[byte];
|
||||
outlen: var int; outval: SomeUVarint): VarintResult[void]</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">putVarint
|
||||
<li><a class="reference" href="#putVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeVarint" title="putVarint[T: PB | LP](vtype: typedesc[T]; pbytes: var openArray[byte];
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">putVarint
|
||||
<li><a class="reference" href="#putVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeVarint"
|
||||
title="putVarint[T: PB | LP](vtype: typedesc[T]; pbytes: var openArray[byte];
|
||||
nbytes: var int; value: SomeVarint): VarintResult[void]">putVarint[T: PB | LP](vtype: typedesc[T]; pbytes: var openArray[byte];
|
||||
nbytes: var int; value: SomeVarint): VarintResult[void]</a></li>
|
||||
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">vsizeof
|
||||
<li><a class="reference" href="#vsizeof%2CSomeVarint" title="vsizeof(x: SomeVarint): int">vsizeof(x: SomeVarint): int</a></li>
|
||||
</ul>
|
||||
<ul class="simple nested-toc-section">vsizeof
|
||||
<li><a class="reference" href="#vsizeof%2CSomeVarint"
|
||||
title="vsizeof(x: SomeVarint): int">vsizeof(x: SomeVarint): int</a></li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</details>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<details open>
|
||||
<summary><a class="reference reference-toplevel" href="#18" id="68">Templates</a></summary>
|
||||
<ul class="simple simple-toc-section">
|
||||
<a class="reference reference-toplevel" href="#18" id="68">Templates</a>
|
||||
<ul class="simple simple-toc-section">
|
||||
<ul class="simple nested-toc-section">toBytes
|
||||
<li><a class="reference" href="#toBytes.t%2Ctypedesc%5BPB%5D%2CPBSomeVarint" title="toBytes(vtype: typedesc[PB]; value: PBSomeVarint): auto">toBytes(vtype: typedesc[PB]; value: PBSomeVarint): auto</a></li>
|
||||
<li><a class="reference" href="#toBytes.t%2Ctypedesc%5BPB%5D%2CPBSomeVarint"
|
||||
title="toBytes(vtype: typedesc[PB]; value: PBSomeVarint): auto">toBytes(vtype: typedesc[PB]; value: PBSomeVarint): auto</a></li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</details>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="nine columns" id="content">
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L1" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L1"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
<div id="tocRoot"></div>
|
||||
|
||||
<p class="module-desc">This module implements Variable Integer <tt class="docutils literal"><span class="pre"><span class="Identifier">VARINT</span></span></tt>. This module supports two variants of variable integer<ul class="simple"><li>Google ProtoBuf varint, which is able to encode full uint64 number and maximum size of encoded value is 10 octets (bytes). <a class="reference external" href="https://developers.google.com/protocol-buffers/docs/encoding#varints">https://developers.google.com/protocol-buffers/docs/encoding#varints</a></li>
|
||||
<div class="nine columns" id="content">
|
||||
<div id="tocRoot"></div>
|
||||
|
||||
<p class="module-desc">This module implements Variable Integer <tt class="docutils literal"><span class="pre"><span class="Identifier">VARINT</span></span></tt>. This module supports two variants of variable integer<ul class="simple"><li>Google ProtoBuf varint, which is able to encode full uint64 number and maximum size of encoded value is 10 octets (bytes). <a class="reference external" href="https://developers.google.com/protocol-buffers/docs/encoding#varints">https://developers.google.com/protocol-buffers/docs/encoding#varints</a></li>
|
||||
<li>LibP2P varint, which is able to encode only 63bits of uint64 number and maximum size of encoded value is 9 octets (bytes). <a class="reference external" href="https://github.com/multiformats/unsigned-varint">https://github.com/multiformats/unsigned-varint</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
<div class="section" id="7">
|
||||
<h1><a class="toc-backref" href="#7">Types</a></h1>
|
||||
<dl class="item">
|
||||
<div id="hint" class="tohide">
|
||||
<div class="section" id="7">
|
||||
<h1><a class="toc-backref" href="#7">Types</a></h1>
|
||||
<dl class="item">
|
||||
<div id="hint" class="tohide">
|
||||
<dt><pre><a href="varint.html#hint"><span class="Identifier">hint</span></a> <span class="Other">=</span> <span class="Keyword">distinct</span> <span class="Identifier">int</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
Signed integer types which will be encoded using simple cast.
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L46" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L46" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L46"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L46" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -271,8 +348,10 @@ Signed integer types which will be encoded using simple cast.
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L44" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L44" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L44"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L44" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -281,8 +360,10 @@ Signed integer types which will be encoded using simple cast.
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L45" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L45" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L45"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L45" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -292,8 +373,10 @@ Signed integer types which will be encoded using simple cast.
|
|||
<dd>
|
||||
|
||||
Use this type to specify LibP2P varint encoding
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L36" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L36" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L36"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L36" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -302,8 +385,10 @@ Use this type to specify LibP2P varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L53" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L53" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L53"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L53" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -312,8 +397,10 @@ Use this type to specify LibP2P varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L54" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L54" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L54"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L54" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -323,8 +410,10 @@ Use this type to specify LibP2P varint encoding
|
|||
<dd>
|
||||
|
||||
Use this type to specify Google ProtoBuf's varint encoding
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L34" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L34" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L34"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L34" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -333,8 +422,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L50" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L50" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L50"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L50" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -343,8 +434,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L49" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L49" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L49"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L49" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -353,8 +446,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L52" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L52" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L52"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L52" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -363,8 +458,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L51" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L51" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L51"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L51" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -373,8 +470,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L56" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L56" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L56"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L56" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -383,8 +482,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L55" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L55" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L55"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L55" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -394,8 +495,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L25" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L25" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L25"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L25" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -404,8 +507,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L32" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L32" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L32"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L32" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -414,8 +519,10 @@ Use this type to specify Google ProtoBuf's varint encoding
|
|||
<dd>
|
||||
|
||||
Signed integer types which will be encoded using zigzag encoding.
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L41" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L41" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L41"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L41" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -424,8 +531,10 @@ Signed integer types which will be encoded using zigzag encoding.
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L39" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L39" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L39"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L39" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -434,26 +543,28 @@ Signed integer types which will be encoded using zigzag encoding.
|
|||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L40" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L40" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L40"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L40" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
</dl></div>
|
||||
<div class="section" id="12">
|
||||
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
||||
<dl class="item">
|
||||
<div id="encodeVarint-procs-all">
|
||||
<div id="encodeVarint,typedesc[LP],LPSomeVarint" class="tohide">
|
||||
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
||||
<dl class="item">
|
||||
<div id="encodeVarint,typedesc[LP],LPSomeVarint" class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#encodeVarint%2Ctypedesc%5BLP%5D%2CLPSomeVarint"><span class="Identifier">encodeVarint</span></a><span class="Other">(</span><span class="Identifier">vtype</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="varint.html#LP"><span class="Identifier">LP</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <a href="varint.html#LPSomeVarint"><span class="Identifier">LPSomeVarint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="varint.html#VarintResult"><span class="Identifier">VarintResult</span></a><span class="Other">[</span>
|
||||
<span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">]</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
Encode integer to LibP2P <tt class="docutils literal"><span class="pre"><span class="Identifier">unsigned</span> <span class="Identifier">varint</span></span></tt> and returns sequence of bytes as buffer.
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L288" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L288" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L288"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L288" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
@ -463,15 +574,14 @@ Encode integer to LibP2P <tt class="docutils literal"><span class="pre"><span cl
|
|||
<dd>
|
||||
|
||||
Encode integer to Google ProtoBuf's <tt class="docutils literal"><span class="pre"><span class="Identifier">signed</span><span class="Operator">/</span><span class="Identifier">unsigned</span> <span class="Identifier">varint</span></span></tt> and returns sequence of bytes as buffer.
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L268" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L268" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L268"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L268" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="getSVarint-procs-all">
|
||||
<div id="getSVarint,openArray[byte],int," class="tohide">
|
||||
<div id="getSVarint,openArray[byte],int," class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#getSVarint%2CopenArray%5Bbyte%5D%2Cint%2C"><span class="Identifier">getSVarint</span></a><span class="Other">(</span><span class="Identifier">pbytes</span><span class="Other">:</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">outsize</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">;</span>
|
||||
<span class="Identifier">outval</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Other">(</span><a href="varint.html#PBZigVarint"><span class="Identifier">PBZigVarint</span></a> <span class="Operator">|</span> <a href="varint.html#PBSomeSVarint"><span class="Identifier">PBSomeSVarint</span></a><span class="Other">)</span><span class="Other">)</span><span class="Other">:</span> <a href="varint.html#VarintResult"><span class="Identifier">VarintResult</span></a><span class="Other">[</span><span class="Identifier">void</span><span class="Other">]</span> {.
|
||||
<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
|
@ -484,15 +594,14 @@ Encode integer to Google ProtoBuf's <tt class="docutils literal"><span class="pr
|
|||
<p>If encoded value can produce integer overflow, <tt class="docutils literal"><span class="pre">Overflow</span></tt> error will be returned.</p>
|
||||
<p>Note, when decoding 10th byte of 64bit integer only 1 bit from byte will be decoded, all other bits will be ignored. When decoding 5th byte of 32bit integer only 4 bits from byte will be decoded, all other bits will be ignored.</p>
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L180" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L180" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L180"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L180" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="getUVarint-procs-all">
|
||||
<div id="getUVarint,typedesc[T],openArray[byte],int,SomeUVarint" class="tohide">
|
||||
<div id="getUVarint,typedesc[T],openArray[byte],int,SomeUVarint" class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#getUVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeUVarint"><span class="Identifier">getUVarint</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="varint.html#PB"><span class="Identifier">PB</span></a> <span class="Operator">|</span> <a href="varint.html#LP"><span class="Identifier">LP</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">vtype</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">pbytes</span><span class="Other">:</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">;</span>
|
||||
<span class="Identifier">outlen</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">outval</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="varint.html#SomeUVarint"><span class="Identifier">SomeUVarint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="varint.html#VarintResult"><span class="Identifier">VarintResult</span></a><span class="Other">[</span>
|
||||
<span class="Identifier">void</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
|
@ -505,30 +614,28 @@ Encode integer to Google ProtoBuf's <tt class="docutils literal"><span class="pr
|
|||
<p>Google ProtoBuf When decoding 10th byte of Google Protobuf's 64bit integer only 1 bit from byte will be decoded, all other bits will be ignored. When decoding 5th byte of 32bit integer only 4 bits from byte will be decoded, all other bits will be ignored.</p>
|
||||
<p>LibP2P When decoding 5th byte of 32bit integer only 4 bits from byte will be decoded, all other bits will be ignored.</p>
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L102" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L102" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L102"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L102" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="getVarint-procs-all">
|
||||
<div id="getVarint,typedesc[T],openArray[byte],int,SomeVarint" class="tohide">
|
||||
<div id="getVarint,typedesc[T],openArray[byte],int,SomeVarint" class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#getVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeVarint"><span class="Identifier">getVarint</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="varint.html#PB"><span class="Identifier">PB</span></a> <span class="Operator">|</span> <a href="varint.html#LP"><span class="Identifier">LP</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">vtype</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">pbytes</span><span class="Other">:</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">;</span>
|
||||
<span class="Identifier">nbytes</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="varint.html#SomeVarint"><span class="Identifier">SomeVarint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="varint.html#VarintResult"><span class="Identifier">VarintResult</span></a><span class="Other">[</span>
|
||||
<span class="Identifier">void</span><span class="Other">]</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L247" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L247" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L247"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L247" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="putSVarint-procs-all">
|
||||
<div id="putSVarint,openArray[byte],int," class="tohide">
|
||||
<div id="putSVarint,openArray[byte],int," class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#putSVarint%2CopenArray%5Bbyte%5D%2Cint%2C"><span class="Identifier">putSVarint</span></a><span class="Other">(</span><span class="Identifier">pbytes</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">outsize</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">;</span>
|
||||
<span class="Identifier">outval</span><span class="Other">:</span> <span class="Other">(</span><a href="varint.html#PBZigVarint"><span class="Identifier">PBZigVarint</span></a> <span class="Operator">|</span> <a href="varint.html#PBSomeSVarint"><span class="Identifier">PBSomeSVarint</span></a><span class="Other">)</span><span class="Other">)</span><span class="Other">:</span> <a href="varint.html#VarintResult"><span class="Identifier">VarintResult</span></a><span class="Other">[</span><span class="Identifier">void</span><span class="Other">]</span> {.
|
||||
<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
|
@ -539,15 +646,14 @@ Encode integer to Google ProtoBuf's <tt class="docutils literal"><span class="pr
|
|||
<p>If there not enough bytes available in buffer <tt class="docutils literal"><span class="pre">pbytes</span></tt>, <tt class="docutils literal"><span class="pre">Incomplete</span></tt> error will be returned and <tt class="docutils literal"><span class="pre">outlen</span></tt> will be set to number of bytes required.</p>
|
||||
<p>Maximum encoded length of 64bit integer is 10 octets. Maximum encoded length of 32bit integer is 5 octets.</p>
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L210" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L210" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L210"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L210" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="putUVarint-procs-all">
|
||||
<div id="putUVarint,typedesc[T],openArray[byte],int,SomeUVarint" class="tohide">
|
||||
<div id="putUVarint,typedesc[T],openArray[byte],int,SomeUVarint" class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#putUVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeUVarint"><span class="Identifier">putUVarint</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="varint.html#PB"><span class="Identifier">PB</span></a> <span class="Operator">|</span> <a href="varint.html#LP"><span class="Identifier">LP</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">vtype</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">pbytes</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">;</span>
|
||||
<span class="Identifier">outlen</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">outval</span><span class="Other">:</span> <a href="varint.html#SomeUVarint"><span class="Identifier">SomeUVarint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="varint.html#VarintResult"><span class="Identifier">VarintResult</span></a><span class="Other">[</span>
|
||||
<span class="Identifier">void</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
|
@ -559,77 +665,71 @@ Encode integer to Google ProtoBuf's <tt class="docutils literal"><span class="pr
|
|||
<p>Google ProtoBuf Maximum encoded length of 64bit integer is 10 octets. Maximum encoded length of 32bit integer is 5 octets.</p>
|
||||
<p>LibP2P Maximum encoded length of 63bit integer is 9 octets. Maximum encoded length of 32bit integer is 5 octets.</p>
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L148" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L148" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L148"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L148" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="putVarint-procs-all">
|
||||
<div id="putVarint,typedesc[T],openArray[byte],int,SomeVarint" class="tohide">
|
||||
<div id="putVarint,typedesc[T],openArray[byte],int,SomeVarint" class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#putVarint%2Ctypedesc%5BT%5D%2CopenArray%5Bbyte%5D%2Cint%2CSomeVarint"><span class="Identifier">putVarint</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">:</span> <a href="varint.html#PB"><span class="Identifier">PB</span></a> <span class="Operator">|</span> <a href="varint.html#LP"><span class="Identifier">LP</span></a><span class="Other">]</span><span class="Other">(</span><span class="Identifier">vtype</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">pbytes</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">openArray</span><span class="Other">[</span><span class="Identifier">byte</span><span class="Other">]</span><span class="Other">;</span>
|
||||
<span class="Identifier">nbytes</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <a href="varint.html#SomeVarint"><span class="Identifier">SomeVarint</span></a><span class="Other">)</span><span class="Other">:</span> <a href="varint.html#VarintResult"><span class="Identifier">VarintResult</span></a><span class="Other">[</span>
|
||||
<span class="Identifier">void</span><span class="Other">]</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L230" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L230" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L230"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L230" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="vsizeof-procs-all">
|
||||
<div id="vsizeof,SomeVarint" class="tohide">
|
||||
<div id="vsizeof,SomeVarint" class="tohide">
|
||||
<dt><pre><span class="Keyword">proc</span> <a href="#vsizeof%2CSomeVarint"><span class="Identifier">vsizeof</span></a><span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="varint.html#SomeVarint"><span class="Identifier">SomeVarint</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
||||
<dd>
|
||||
|
||||
Returns number of bytes required to encode integer <tt class="docutils literal"><span class="pre">x</span></tt> as varint.
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L98" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L98" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L98"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L98" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
</dl></div>
|
||||
<div class="section" id="18">
|
||||
<h1><a class="toc-backref" href="#18">Templates</a></h1>
|
||||
<dl class="item">
|
||||
<div id="toBytes-templates-all">
|
||||
<div id="toBytes.t,typedesc[PB],PBSomeVarint" class="tohide">
|
||||
<h1><a class="toc-backref" href="#18">Templates</a></h1>
|
||||
<dl class="item">
|
||||
<div id="toBytes.t,typedesc[PB],PBSomeVarint" class="tohide">
|
||||
<dt><pre><span class="Keyword">template</span> <a href="#toBytes.t%2Ctypedesc%5BPB%5D%2CPBSomeVarint"><span class="Identifier">toBytes</span></a><span class="Other">(</span><span class="Identifier">vtype</span><span class="Other">:</span> <span class="Identifier">typedesc</span><span class="Other">[</span><a href="varint.html#PB"><span class="Identifier">PB</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <a href="varint.html#PBSomeVarint"><span class="Identifier">PBSomeVarint</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">auto</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<a href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L265" class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L265" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a
|
||||
href="https://github.com/status-im/nim-libp2p/tree/ci-workflow-stability/libp2p/varint.nim#L265"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/status-im/nim-libp2p/edit/devel/libp2p/varint.nim#L265" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
</dl></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve-columns footer">
|
||||
<span class="nim-sprite"></span>
|
||||
<br>
|
||||
<small style="color: var(--hint);">Made with Nim. Generated: 2023-12-13 12:51:13 UTC</small>
|
||||
<br/>
|
||||
<small style="color: var(--hint);">Made with Nim. Generated: 2023-12-13 15:37:15 UTC</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Google fonts -->
|
||||
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
|
||||
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue