Skip to content

Commit

Permalink
(automated) deploy from commit a721698
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tiny-kirin committed May 26, 2024
1 parent 7304cd2 commit be75229
Show file tree
Hide file tree
Showing 77 changed files with 879 additions and 434 deletions.
2 changes: 1 addition & 1 deletion search-index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion search.desc/wiwi/wiwi-desc-0-.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-files.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 25 additions & 1 deletion src/wiwi/iter/adapter.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,22 @@
<a href="#133" id="133">133</a>
<a href="#134" id="134">134</a>
<a href="#135" id="135">135</a>
<a href="#136" id="136">136</a>
<a href="#137" id="137">137</a>
<a href="#138" id="138">138</a>
<a href="#139" id="139">139</a>
<a href="#140" id="140">140</a>
<a href="#141" id="141">141</a>
<a href="#142" id="142">142</a>
<a href="#143" id="143">143</a>
<a href="#144" id="144">144</a>
<a href="#145" id="145">145</a>
<a href="#146" id="146">146</a>
<a href="#147" id="147">147</a>
</pre></div><pre class="rust"><code><span class="doccomment">//! Adapter traits and [`IterAdapter`], to aid in converting between and using std
//! [`Iterator`]s as wiwi [`Iter`]s, and vice versa

</span><span class="kw">use super</span>::{ IntoIter, Iter, SizeHint };
</span><span class="kw">use super</span>::{ DoubleEndedIter, IntoIter, Iter, SizeHint };

<span class="doccomment">/// An adapter that wraps either a std [`Iterator`] or a wiwi [`Iter`], and then
/// acts as the other. Basically, with every layer you layer it, it flip flops
Expand Down Expand Up @@ -185,6 +197,18 @@
}
}

<span class="kw">impl</span>&lt;I: DoubleEndedIter&gt; DoubleEndedIterator <span class="kw">for </span>IterAdapter&lt;I&gt; {
<span class="kw">fn </span>next_back(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="self">Self</span>::Item&gt; {
<span class="self">self</span>.inner.next_back()
}
}

<span class="kw">impl</span>&lt;I: DoubleEndedIterator&gt; DoubleEndedIter <span class="kw">for </span>IterAdapter&lt;I&gt; {
<span class="kw">fn </span>next_back(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="self">Self</span>::Item&gt; {
<span class="self">self</span>.inner.next_back()
}
}

<span class="doccomment">/// Allows any std iterator to be borrowed as a wiwi iter. There is a
/// blanket implementation provided, so it is available for all std iterators.
</span><span class="kw">pub trait </span>AsWiwiIter&lt;<span class="lifetime">'h</span>&gt; {
Expand Down
53 changes: 53 additions & 0 deletions src/wiwi/iter/double_ended.rs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/iter/double_ended.rs`."><title>double_ended.rs - source</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="wiwi" data-themes="meadow" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ab14f944a 2024-05-13)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../../../static.files/src-script-e66d777a5a92e9b2.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="src-sidebar-title"><h2>Files</h2></div></nav><div class="sidebar-resizer"></div><main><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
<a href="#5" id="5">5</a>
<a href="#6" id="6">6</a>
<a href="#7" id="7">7</a>
<a href="#8" id="8">8</a>
<a href="#9" id="9">9</a>
<a href="#10" id="10">10</a>
<a href="#11" id="11">11</a>
<a href="#12" id="12">12</a>
<a href="#13" id="13">13</a>
<a href="#14" id="14">14</a>
<a href="#15" id="15">15</a>
<a href="#16" id="16">16</a>
<a href="#17" id="17">17</a>
<a href="#18" id="18">18</a>
<a href="#19" id="19">19</a>
<a href="#20" id="20">20</a>
<a href="#21" id="21">21</a>
<a href="#22" id="22">22</a>
<a href="#23" id="23">23</a>
<a href="#24" id="24">24</a>
<a href="#25" id="25">25</a>
<a href="#26" id="26">26</a>
</pre></div><pre class="rust"><code><span class="kw">use super</span>::{ Iter, Rev };

<span class="kw">pub trait </span>DoubleEndedIter: Iter {
<span class="kw">fn </span>next_back(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="self">Self</span>::Item&gt;;

<span class="kw">fn </span>rev(<span class="self">self</span>) -&gt; Rev&lt;<span class="self">Self</span>&gt;
<span class="kw">where
</span><span class="self">Self</span>: Sized
{
Rev::new(<span class="self">self</span>)
}

<span class="kw">fn </span>for_each_back&lt;F&gt;(<span class="kw-2">mut </span><span class="self">self</span>, <span class="kw-2">mut </span>f: F)
<span class="kw">where
</span><span class="self">Self</span>: Sized,
F: FnMut(<span class="self">Self</span>::Item)
{
<span class="self">self</span>.rev().for_each(f)
}
}

<span class="kw">impl</span>&lt;I: DoubleEndedIter&gt; DoubleEndedIter <span class="kw">for </span><span class="kw-2">&amp;mut </span>I {
<span class="kw">fn </span>next_back(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="self">Self</span>::Item&gt; {
(<span class="kw-2">**</span><span class="self">self</span>).next_back()
}
}
</code></pre></div></section></main></body></html>
12 changes: 12 additions & 0 deletions src/wiwi/iter/mod.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@
<a href="#273" id="273">273</a>
<a href="#274" id="274">274</a>
<a href="#275" id="275">275</a>
<a href="#276" id="276">276</a>
<a href="#277" id="277">277</a>
<a href="#278" id="278">278</a>
<a href="#279" id="279">279</a>
<a href="#280" id="280">280</a>
<a href="#281" id="281">281</a>
</pre></div><pre class="rust"><code><span class="kw">mod </span>adapter;
<span class="kw">pub use </span>adapter::{
AsStdIterator,
Expand All @@ -282,6 +288,9 @@
IterAdapter
};

<span class="kw">mod </span>double_ended;
<span class="kw">pub use </span>double_ended::DoubleEndedIter;

<span class="kw">mod </span>empty;
<span class="kw">pub use </span>empty::{ empty, Empty };

Expand All @@ -300,6 +309,9 @@
<span class="kw">mod </span>repeat_per_item;
<span class="kw">pub use </span>repeat_per_item::RepeatPerItem;

<span class="kw">mod </span>rev;
<span class="kw">pub use </span>rev::Rev;

<span class="kw">mod </span>size_hint;
<span class="kw">pub use </span>size_hint::{ SizeHint, SizeHintBound };

Expand Down
67 changes: 67 additions & 0 deletions src/wiwi/iter/rev.rs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/iter/rev.rs`."><title>rev.rs - source</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="wiwi" data-themes="meadow" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (ab14f944a 2024-05-13)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="../../../static.files/src-script-e66d777a5a92e9b2.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="src-sidebar-title"><h2>Files</h2></div></nav><div class="sidebar-resizer"></div><main><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
<a href="#2" id="2">2</a>
<a href="#3" id="3">3</a>
<a href="#4" id="4">4</a>
<a href="#5" id="5">5</a>
<a href="#6" id="6">6</a>
<a href="#7" id="7">7</a>
<a href="#8" id="8">8</a>
<a href="#9" id="9">9</a>
<a href="#10" id="10">10</a>
<a href="#11" id="11">11</a>
<a href="#12" id="12">12</a>
<a href="#13" id="13">13</a>
<a href="#14" id="14">14</a>
<a href="#15" id="15">15</a>
<a href="#16" id="16">16</a>
<a href="#17" id="17">17</a>
<a href="#18" id="18">18</a>
<a href="#19" id="19">19</a>
<a href="#20" id="20">20</a>
<a href="#21" id="21">21</a>
<a href="#22" id="22">22</a>
<a href="#23" id="23">23</a>
<a href="#24" id="24">24</a>
<a href="#25" id="25">25</a>
<a href="#26" id="26">26</a>
<a href="#27" id="27">27</a>
<a href="#28" id="28">28</a>
<a href="#29" id="29">29</a>
<a href="#30" id="30">30</a>
<a href="#31" id="31">31</a>
<a href="#32" id="32">32</a>
<a href="#33" id="33">33</a>
</pre></div><pre class="rust"><code><span class="kw">use super</span>::{ DoubleEndedIter, Iter, SizeHint };

<span class="kw">pub struct </span>Rev&lt;I&gt; {
iter: I
}

<span class="kw">impl</span>&lt;I: DoubleEndedIter&gt; Rev&lt;I&gt; {
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>new(iter: I) -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{ iter }
}

<span class="kw">pub fn </span>into_inner(<span class="self">self</span>) -&gt; I {
<span class="self">self</span>.iter
}
}

<span class="kw">impl</span>&lt;I: DoubleEndedIter&gt; Iter <span class="kw">for </span>Rev&lt;I&gt; {
<span class="kw">type </span>Item = I::Item;

<span class="kw">fn </span>next(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;I::Item&gt; {
<span class="self">self</span>.iter.next_back()
}

<span class="kw">fn </span>size_hint(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; SizeHint {
<span class="self">self</span>.iter.size_hint()
}
}

<span class="kw">impl</span>&lt;I: DoubleEndedIter&gt; DoubleEndedIter <span class="kw">for </span>Rev&lt;I&gt; {
<span class="kw">fn </span>next_back(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;I::Item&gt; {
<span class="self">self</span>.iter.next()
}
}
</code></pre></div></section></main></body></html>
22 changes: 10 additions & 12 deletions src/wiwi/serialiser/buffer.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
<a href="#97" id="97">97</a>
<a href="#98" id="98">98</a>
<a href="#99" id="99">99</a>
<a href="#100" id="100">100</a>
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">super</span>::error::<span class="kw-2">*</span>;
<span class="kw">use </span>std::{ ptr, slice };
<span class="kw">use </span>std::future::Future;
Expand Down Expand Up @@ -167,13 +166,10 @@
<span class="macro">debug_assert!</span>(<span class="self">self</span>.capacity() &gt;= <span class="self">self</span>.len() + bytes.len());

<span class="self">self</span>.with_ptr(|ptr| {
ptr::copy_nonoverlapping(
bytes <span class="kw">as </span><span class="kw-2">*const </span>[u8] <span class="kw">as </span><span class="kw-2">*const </span>u8,
ptr,
bytes.len()
);

bytes.len()
<span class="kw">let </span>len = bytes.len();
<span class="kw">let </span>bytes_ptr = bytes <span class="kw">as </span><span class="kw-2">*const </span>[u8] <span class="kw">as </span><span class="kw-2">*const </span>u8;
ptr::copy_nonoverlapping(bytes_ptr, ptr, len);
len
});
}

Expand All @@ -182,18 +178,20 @@
<span class="kw">where
</span>F: FnOnce(<span class="kw-2">*mut </span>u8) -&gt; usize
{
<span class="kw">let </span>ptr = <span class="self">self</span>.as_mut_ptr().add(<span class="self">self</span>.len());
<span class="kw">let </span>len = <span class="self">self</span>.len();
<span class="kw">let </span>ptr = <span class="self">self</span>.as_mut_ptr().add(len);
<span class="kw">let </span>count = f(ptr);
<span class="self">self</span>.set_len(<span class="self">self</span>.len() + count);
<span class="self">self</span>.set_len(len + count);
}
}

<span class="kw">impl</span>&lt;<span class="lifetime">'h</span>&gt; BufferRead&lt;<span class="lifetime">'h</span>&gt; <span class="kw">for </span><span class="kw-2">&amp;</span><span class="lifetime">'h </span>[u8] {
<span class="attr">#[inline]
</span><span class="kw">unsafe fn </span>read_bytes_ptr(<span class="kw-2">&amp;mut </span><span class="self">self</span>, count: usize) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="kw-2">*const </span>u8&gt; {
(<span class="self">self</span>.len() &gt;= count).then(|| {
<span class="kw">let </span>len = <span class="self">self</span>.len();
(len &gt;= count).then(|| {
<span class="kw">let </span>ptr = <span class="kw-2">*</span><span class="self">self </span><span class="kw">as </span><span class="kw-2">*const </span>[u8] <span class="kw">as </span><span class="kw-2">*const </span>u8;
<span class="kw-2">*</span><span class="self">self </span>= slice::from_raw_parts(ptr.add(count), <span class="self">self</span>.len() - count);
<span class="kw-2">*</span><span class="self">self </span>= slice::from_raw_parts(ptr.add(count), len - count);
ptr
}).err_eof()
}
Expand Down
Loading

0 comments on commit be75229

Please sign in to comment.