Skip to content

Commit fb13bce

Browse files
committed
rebuild pages at f37823b
1 parent ce602fa commit fb13bce

File tree

12 files changed

+123
-65
lines changed

12 files changed

+123
-65
lines changed

doc/implementors/core/error/trait.Error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function() {var implementors = {};
2-
implementors['r2d2_postgres'] = ["<a class='stability Unstable' title='Unstable: the exact API of this trait may change'></a>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/error/trait.Error.html' title='core::error::Error'>Error</a> for <a class='enum' href='r2d2_postgres/enum.Error.html' title='r2d2_postgres::Error'>Error</a>",];
2+
implementors['r2d2_postgres'] = ["<a class='stability Stable' title='Stable'></a>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/error/trait.Error.html' title='core::error::Error'>Error</a> for <a class='enum' href='r2d2_postgres/enum.Error.html' title='r2d2_postgres::Error'>Error</a>",];
33

44
if (window.register_implementors) {
55
window.register_implementors(implementors);

doc/main.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ h2 {
8383
h3 {
8484
font-size: 1.3em;
8585
}
86-
h1, h2, h3:not(.impl):not(.method):not(.type), h4:not(.method):not(.type) {
86+
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
8787
color: black;
8888
font-weight: 500;
8989
margin: 20px 0 15px 0;
@@ -93,7 +93,7 @@ h1.fqn {
9393
border-bottom: 1px dashed #D5D5D5;
9494
margin-top: 0;
9595
}
96-
h2, h3:not(.impl):not(.method):not(.type), h4:not(.method):not(.type) {
96+
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
9797
border-bottom: 1px solid #DDDDDD;
9898
}
9999
h3.impl, h3.method, h4.method, h3.type, h4.type {

doc/main.js

Lines changed: 100 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,27 @@
1515
"use strict";
1616
var resizeTimeout, interval;
1717

18+
// This mapping table should match the discriminants of
19+
// `rustdoc::html::item_type::ItemType` type in Rust.
20+
var itemTypes = ["mod",
21+
"externcrate",
22+
"import",
23+
"struct",
24+
"enum",
25+
"fn",
26+
"type",
27+
"static",
28+
"trait",
29+
"impl",
30+
"tymethod",
31+
"method",
32+
"structfield",
33+
"variant",
34+
"macro",
35+
"primitive",
36+
"associatedtype",
37+
"constant"];
38+
1839
$('.js-only').removeClass('js-only');
1940

2041
function getQueryStringParams() {
@@ -33,23 +54,6 @@
3354
return window.history && typeof window.history.pushState === "function";
3455
}
3556

36-
function resizeShortBlocks() {
37-
if (resizeTimeout) {
38-
clearTimeout(resizeTimeout);
39-
}
40-
resizeTimeout = setTimeout(function() {
41-
var contentWidth = $('.content').width();
42-
$('.docblock.short').width(function() {
43-
return contentWidth - 40 - $(this).prev().width();
44-
}).addClass('nowrap');
45-
$('.summary-column').width(function() {
46-
return contentWidth - 40 - $(this).prev().width();
47-
})
48-
}, 150);
49-
}
50-
resizeShortBlocks();
51-
$(window).on('resize', resizeShortBlocks);
52-
5357
function highlightSourceLines(ev) {
5458
var i, from, to, match = window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);
5559
if (match) {
@@ -205,6 +209,33 @@
205209
break;
206210
}
207211
}
212+
// searching by type
213+
} else if (val.search("->") > -1) {
214+
var trimmer = function (s) { return s.trim(); };
215+
var parts = val.split("->").map(trimmer);
216+
var input = parts[0];
217+
// sort inputs so that order does not matter
218+
var inputs = input.split(",").map(trimmer).sort();
219+
var output = parts[1];
220+
221+
for (var i = 0; i < nSearchWords; ++i) {
222+
var type = searchIndex[i].type;
223+
if (!type) {
224+
continue;
225+
}
226+
227+
// sort index inputs so that order does not matter
228+
var typeInputs = type.inputs.map(function (input) {
229+
return input.name;
230+
}).sort();
231+
232+
// allow searching for void (no output) functions as well
233+
var typeOutput = type.output ? type.output.name : "";
234+
if (inputs.toString() === typeInputs.toString() &&
235+
output == typeOutput) {
236+
results.push({id: i, index: -1, dontValidate: true});
237+
}
238+
}
208239
} else {
209240
// gather matching search results up to a certain maximum
210241
val = val.replace(/\_/g, "");
@@ -325,6 +356,11 @@
325356
path = result.item.path.toLowerCase(),
326357
parent = result.item.parent;
327358

359+
// this validation does not make sense when searching by types
360+
if (result.dontValidate) {
361+
continue;
362+
}
363+
328364
var valid = validateResult(name, path, split, parent);
329365
if (!valid) {
330366
result.id = -1;
@@ -552,27 +588,6 @@
552588
showResults(results);
553589
}
554590

555-
// This mapping table should match the discriminants of
556-
// `rustdoc::html::item_type::ItemType` type in Rust.
557-
var itemTypes = ["mod",
558-
"externcrate",
559-
"import",
560-
"struct",
561-
"enum",
562-
"fn",
563-
"type",
564-
"static",
565-
"trait",
566-
"impl",
567-
"tymethod",
568-
"method",
569-
"structfield",
570-
"variant",
571-
"macro",
572-
"primitive",
573-
"associatedtype",
574-
"constant"];
575-
576591
function itemTypeFromName(typename) {
577592
for (var i = 0; i < itemTypes.length; ++i) {
578593
if (itemTypes[i] === typename) return i;
@@ -590,7 +605,8 @@
590605
// (String) name,
591606
// (String) full path or empty string for previous path,
592607
// (String) description,
593-
// (optional Number) the parent path index to `paths`]
608+
// (Number | null) the parent path index to `paths`]
609+
// (Object | null) the type of the function (if any)
594610
var items = rawSearchIndex[crate].items;
595611
// an array of [(Number) item type,
596612
// (String) name]
@@ -615,7 +631,7 @@
615631
var rawRow = items[i];
616632
var row = {crate: crate, ty: rawRow[0], name: rawRow[1],
617633
path: rawRow[2] || lastPath, desc: rawRow[3],
618-
parent: paths[rawRow[4]]};
634+
parent: paths[rawRow[4]], type: rawRow[5]};
619635
searchIndex.push(row);
620636
if (typeof row.name === "string") {
621637
var word = row.name.toLowerCase();
@@ -708,6 +724,50 @@
708724

709725
window.initSearch = initSearch;
710726

727+
// delayed sidebar rendering.
728+
function initSidebarItems(items) {
729+
var sidebar = $('.sidebar');
730+
var current = window.sidebarCurrent;
731+
732+
function block(shortty, longty) {
733+
var filtered = items[shortty];
734+
if (!filtered) return;
735+
736+
var div = $('<div>').attr('class', 'block ' + shortty);
737+
div.append($('<h2>').text(longty));
738+
739+
for (var i = 0; i < filtered.length; ++i) {
740+
var item = filtered[i];
741+
var name = item[0];
742+
var desc = item[1]; // can be null
743+
744+
var klass = shortty;
745+
if (name === current.name && shortty == current.ty) {
746+
klass += ' current';
747+
}
748+
var path;
749+
if (shortty === 'mod') {
750+
path = name + '/index.html';
751+
} else {
752+
path = shortty + '.' + name + '.html';
753+
}
754+
div.append($('<a>', {'href': current.relpath + path,
755+
'title': desc,
756+
'class': klass}).text(name));
757+
}
758+
sidebar.append(div);
759+
}
760+
761+
block("mod", "Modules");
762+
block("struct", "Structs");
763+
block("enum", "Enums");
764+
block("trait", "Traits");
765+
block("fn", "Functions");
766+
block("macro", "Macros");
767+
}
768+
769+
window.initSidebarItems = initSidebarItems;
770+
711771
window.register_implementors = function(imp) {
712772
var list = $('#implementors-list');
713773
var libs = Object.getOwnPropertyNames(imp);

doc/playpen.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if (window.playgroundUrl) {
1616
$('pre.rust').hover(function() {
1717
var a = $('<a>').text('⇱').attr('class', 'test-arrow');
18-
var code = $(this).siblings(".rusttest").text();
18+
var code = $(this).prev(".rusttest").text();
1919
a.attr('href', window.playgroundUrl + '?code=' +
2020
encodeURIComponent(code));
2121
a.attr('target', '_blank');
@@ -25,4 +25,3 @@
2525
});
2626
}
2727
}());
28-

doc/r2d2_postgres/enum.Error.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<section class="sidebar">
2828

29-
<p class='location'><a href='index.html'>r2d2_postgres</a></p><div class='block struct'><h2>Structs</h2><a class='struct ' href='struct.PostgresConnectionManager.html' title='An `r2d2::ConnectionManager` for `postgres::Connection`s.'>PostgresConnectionManager</a></div><div class='block enum'><h2>Enums</h2><a class='enum current' href='enum.Error.html' title='A unified enum of errors returned by postgres::Connection'>Error</a></div>
29+
<p class='location'><a href='index.html'>r2d2_postgres</a></p><script>window.sidebarCurrent = {name: 'Error', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
3030
</section>
3131

3232
<nav class="sub">
@@ -43,7 +43,7 @@
4343
<section id='main' class="content enum">
4444
<h1 class='fqn'><span class='in-band'>Enum <a href='index.html'>r2d2_postgres</a>::<wbr><a class='enum' href=''>Error</a><wbr></span><span class='out-of-band'><span id='render-detail'>
4545
<a id="collapse-all" href="#">[-]</a>&nbsp;<a id="expand-all" href="#">[+]</a>
46-
</span><a id='src-12' href='../src/r2d2_postgres/lib.rs.html#15-20'>[src]</a></span></h1>
46+
</span><a id='src-12' href='../src/r2d2_postgres/lib.rs.html#14-19'>[src]</a></span></h1>
4747
<pre class='rust enum'>pub enum Error {
4848
Connect(<a class='enum' href='https://sfackler.github.io/rust-postgres/doc/postgres/error/enum.ConnectError.html' title='postgres::error::ConnectError'>ConnectError</a>),
4949
Other(<a class='enum' href='https://sfackler.github.io/rust-postgres/doc/postgres/error/enum.Error.html' title='postgres::error::Error'>Error</a>),
@@ -52,8 +52,8 @@ <h1 class='fqn'><span class='in-band'>Enum <a href='index.html'>r2d2_postgres</a
5252
<table><tr><td id='variant.Connect'><a class='stability Unmarked' title='No stability level'></a><code>Connect</code></td><td><div class='docblock'><p>A postgres::ConnectError</p>
5353
</div></td></tr><tr><td id='variant.Other'><a class='stability Unmarked' title='No stability level'></a><code>Other</code></td><td><div class='docblock'><p>An postgres::Error</p>
5454
</div></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><a class='stability Stable' title='Stable'></a><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='enum' href='../r2d2_postgres/enum.Error.html' title='r2d2_postgres::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><a class='stability Stable' title='Stable'></a><code>fn <a href='#method.fmt' class='fnname'>fmt</a>(&amp;self, fmt: &amp;mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='http://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
55-
</div><h3 class='impl'><a class='stability Unstable' title='Unstable: the exact API of this trait may change'></a><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/error/trait.Error.html' title='core::error::Error'>Error</a> for <a class='enum' href='../r2d2_postgres/enum.Error.html' title='r2d2_postgres::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.description' class='method'><a class='stability Unstable' title='Unstable: the exact API of this trait may change'></a><code>fn <a href='#method.description' class='fnname'>description</a>(&amp;self) -&gt; &amp;<a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a></code></h4>
56-
<h4 id='method.cause' class='method'><a class='stability Unstable' title='Unstable: the exact API of this trait may change'></a><code>fn <a href='#method.cause' class='fnname'>cause</a>(&amp;self) -&gt; <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;<a class='trait' href='http://doc.rust-lang.org/nightly/core/error/trait.Error.html' title='core::error::Error'>Error</a>&gt;</code></h4>
55+
</div><h3 class='impl'><a class='stability Stable' title='Stable'></a><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/error/trait.Error.html' title='core::error::Error'>Error</a> for <a class='enum' href='../r2d2_postgres/enum.Error.html' title='r2d2_postgres::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.description' class='method'><a class='stability Stable' title='Stable'></a><code>fn <a href='#method.description' class='fnname'>description</a>(&amp;self) -&gt; &amp;<a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a></code></h4>
56+
<h4 id='method.cause' class='method'><a class='stability Stable' title='Stable'></a><code>fn <a href='#method.cause' class='fnname'>cause</a>(&amp;self) -&gt; <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;<a class='trait' href='http://doc.rust-lang.org/nightly/core/error/trait.Error.html' title='core::error::Error'>Error</a>&gt;</code></h4>
5757
</div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><a class='stability Stable' title='Stable'></a><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../r2d2_postgres/enum.Error.html' title='r2d2_postgres::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><a class='stability Stable' title='Stable'></a><code>fn <a href='#method.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='http://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
5858
</div><h3 class='impl'><a class='stability Stable' title='Stable'></a><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../r2d2_postgres/enum.Error.html' title='r2d2_postgres::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><a class='stability Stable' title='Stable'></a><code>fn <a href='#method.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../r2d2_postgres/enum.Error.html' title='r2d2_postgres::Error'>Error</a></code></h4>
5959
<h4 id='method.clone_from' class='tymethod'><a class='stability Unstable' title='Unstable: this function is rarely used'></a><code>fn <a href='#tymethod.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code></h4>

doc/r2d2_postgres/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<section class="sidebar">
2828

29-
<p class='location'></p>
29+
<p class='location'></p><script>window.sidebarCurrent = {name: 'r2d2_postgres', ty: 'mod', relpath: '../'};</script>
3030
</section>
3131

3232
<nav class="sub">
@@ -43,7 +43,7 @@
4343
<section id='main' class="content mod">
4444
<h1 class='fqn'><span class='in-band'>Crate <a class='mod' href=''>r2d2_postgres</a><wbr></span><span class='out-of-band'><a href='stability.html'>[stability]</a> <span id='render-detail'>
4545
<a id="collapse-all" href="#">[-]</a>&nbsp;<a id="expand-all" href="#">[+]</a>
46-
</span><a id='src-0' href='../src/r2d2_postgres/lib.rs.html#1-121'>[src]</a></span></h1>
46+
</span><a id='src-0' href='../src/r2d2_postgres/lib.rs.html#1-120'>[src]</a></span></h1>
4747
<div class='docblock'><p>Postgres support for the <code>r2d2</code> connection pool.</p>
4848
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
4949
<table>

doc/r2d2_postgres/sidebar-items.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/r2d2_postgres/stability.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<section class="sidebar">
2828

29-
<p class='location'></p>
29+
<p class='location'></p><script>window.sidebarCurrent = {name: 'r2d2_postgres', ty: 'mod', relpath: '../'};</script>
3030
</section>
3131

3232
<nav class="sub">
@@ -45,13 +45,13 @@
4545
the crate, according to the total number of items at each level in the module and
4646
its children (percentages total for r2d2_postgres):
4747
<blockquote>
48-
<a class='stability Stable'></a> stable (30%),<br/>
49-
<a class='stability Unstable'></a> unstable (7%),<br/>
48+
<a class='stability Stable'></a> stable (38%),<br/>
49+
<a class='stability Unstable'></a> unstable (0%),<br/>
5050
<a class='stability Deprecated'></a> deprecated (0%),<br/>
5151
<a class='stability Unmarked'></a> unmarked (61%)
5252
</blockquote>
5353
The counts do not include methods or trait
54-
implementations that are visible only through a re-exported type.<table><tr><td><a href='index.html'>r2d2_postgres</a></td><td class='summary-column'><span class='summary Stable' style='width: 30.7692%; display: inline-block'>&nbsp</span><span class='summary Unstable' style='width: 7.6923%; display: inline-block'>&nbsp</span><span class='summary Deprecated' style='width: 0.0000%; display: inline-block'>&nbsp</span><span class='summary Unmarked' style='width: 61.5385%; display: inline-block'>&nbsp</span></td></tr></table></section>
54+
implementations that are visible only through a re-exported type.<table><tr><td><a href='index.html'>r2d2_postgres</a></td><td class='summary-column'><span class='summary Stable' style='width: 38.4615%; display: inline-block'>&nbsp</span><span class='summary Unstable' style='width: 0.0000%; display: inline-block'>&nbsp</span><span class='summary Deprecated' style='width: 0.0000%; display: inline-block'>&nbsp</span><span class='summary Unmarked' style='width: 61.5385%; display: inline-block'>&nbsp</span></td></tr></table></section>
5555
<section id='search' class="content hidden"></section>
5656

5757
<section class="footer"></section>

doc/r2d2_postgres/stability.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"r2d2_postgres","counts":{"deprecated":0,"unstable":1,"stable":4,"unmarked":8},"submodules":[]}
1+
{"name":"r2d2_postgres","counts":{"deprecated":0,"unstable":0,"stable":5,"unmarked":8},"submodules":[]}

0 commit comments

Comments
 (0)