Skip to content

Commit cdb1931

Browse files
committed
publish: Correct documentation for Array::copy and Clone trait
generated from commit 4466e0c
1 parent 51621ce commit cdb1931

File tree

7 files changed

+32
-11
lines changed

7 files changed

+32
-11
lines changed

arrayfire/fn.eval_multiple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1 class='fqn'><span class='in-band'>Function <a href='index.html'>arrayfire</a
4747
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
4848
[<span class='inner'>&#x2212;</span>]
4949
</a>
50-
</span><a class='srclink' href='../src/arrayfire/array.rs.html#497-507' title='goto source code'>[src]</a></span></h1>
50+
</span><a class='srclink' href='../src/arrayfire/array.rs.html#504-514' title='goto source code'>[src]</a></span></h1>
5151
<pre class='rust fn'>pub fn eval_multiple(inputs: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;&amp;<a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a>&gt;)</pre><div class='docblock'><p>evaluate multiple arrays</p>
5252

5353
<p>Use this function to evaluate multiple arrays in single call</p>

arrayfire/fn.is_eval_manual.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1 class='fqn'><span class='in-band'>Function <a href='index.html'>arrayfire</a
4747
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
4848
[<span class='inner'>&#x2212;</span>]
4949
</a>
50-
</span><a class='srclink' href='../src/arrayfire/array.rs.html#531-538' title='goto source code'>[src]</a></span></h1>
50+
</span><a class='srclink' href='../src/arrayfire/array.rs.html#538-545' title='goto source code'>[src]</a></span></h1>
5151
<pre class='rust fn'>pub fn is_eval_manual() -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></pre><div class='docblock'><p>Get eval flag value</p>
5252

5353
<p>This function can be used to find out if manual evaluation of arrays is

arrayfire/fn.print.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1 class='fqn'><span class='in-band'>Function <a href='index.html'>arrayfire</a
4747
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
4848
[<span class='inner'>&#x2212;</span>]
4949
</a>
50-
</span><a class='srclink' href='../src/arrayfire/array.rs.html#439-446' title='goto source code'>[src]</a></span></h1>
50+
</span><a class='srclink' href='../src/arrayfire/array.rs.html#446-453' title='goto source code'>[src]</a></span></h1>
5151
<pre class='rust fn'>pub fn print(input: &amp;<a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a>)</pre><div class='docblock'><p>Print data in the Array</p>
5252

5353
<h1 id='parameters' class='section-header'><a href='#parameters'>Parameters</a></h1>

arrayfire/fn.print_gen.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1 class='fqn'><span class='in-band'>Function <a href='index.html'>arrayfire</a
4747
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
4848
[<span class='inner'>&#x2212;</span>]
4949
</a>
50-
</span><a class='srclink' href='../src/arrayfire/array.rs.html#480-488' title='goto source code'>[src]</a></span></h1>
50+
</span><a class='srclink' href='../src/arrayfire/array.rs.html#487-495' title='goto source code'>[src]</a></span></h1>
5151
<pre class='rust fn'>pub fn print_gen(msg: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>, input: &amp;<a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a>, precision: <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i32.html'>i32</a>&gt;)</pre><div class='docblock'><p>Generalized Array print function</p>
5252

5353
<p>Use this function to print Array data with arbitrary preicsion</p>

arrayfire/fn.set_manual_eval.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1 class='fqn'><span class='in-band'>Function <a href='index.html'>arrayfire</a
4747
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
4848
[<span class='inner'>&#x2212;</span>]
4949
</a>
50-
</span><a class='srclink' href='../src/arrayfire/array.rs.html#516-521' title='goto source code'>[src]</a></span></h1>
50+
</span><a class='srclink' href='../src/arrayfire/array.rs.html#523-528' title='goto source code'>[src]</a></span></h1>
5151
<pre class='rust fn'>pub fn set_manual_eval(flag: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>)</pre><div class='docblock'><p>Set eval flag value</p>
5252

5353
<p>This function can be used to toggle on/off the manual evaluation of arrays.</p>

arrayfire/struct.Array.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ <h1 id='return-values-1' class='section-header'><a href='#return-values-1'>Retur
9797
</div><h4 id='method.copy' class='method'><span id='copy.v' class='invisible'><code>fn <a href='#method.copy' class='fnname'>copy</a>(&amp;self) -&gt; <a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a></code></span></h4>
9898
<div class='docblock'><p>Makes an copy of the Array</p>
9999

100-
<p>Internally, this is handled by reference counting</p>
100+
<p>This does a deep copy of the data into a new Array</p>
101101
</div><h4 id='method.is_empty' class='method'><span id='is_empty.v' class='invisible'><code>fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></span></h4>
102102
<div class='docblock'><p>Check if Array is empty</p>
103103
</div><h4 id='method.is_scalar' class='method'><span id='is_scalar.v' class='invisible'><code>fn <a href='#method.is_scalar' class='fnname'>is_scalar</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></span></h4>
@@ -147,13 +147,20 @@ <h1 id='return-values-1' class='section-header'><a href='#return-values-1'>Retur
147147
<div class='docblock'><p>Used for creating Array object from native resource id</p>
148148
</div><div class='impl-items'><h4 id='method.from' class='method'><span id='from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i64.html'>i64</a>) -&gt; <a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a></code></span></h4>
149149
<div class='docblock'><p>Performs the conversion.</p>
150-
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/arrayfire/array.rs.html#387-398' title='goto source code'>[src]</a></span></h3>
151-
<div class='docblock'><p>Used for incrementing the reference count of Array&#39;s native resource</p>
150+
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/arrayfire/array.rs.html#394-405' title='goto source code'>[src]</a></span></h3>
151+
<div class='docblock'><p>Returns a new Array object after incrementing the reference count of native resource</p>
152+
153+
<p>Cloning an Array does not do a deep copy of the underlying array data. It increments the
154+
reference count of native resource and returns you the new reference in the form a new Array
155+
object.</p>
156+
157+
<p>To create a deep copy use
158+
<a href="http://arrayfire.org/arrayfire-rust/arrayfire/struct.Array.html#method.copy">copy()</a></p>
152159
</div><div class='impl-items'><h4 id='method.clone' class='method'><span id='clone.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a></code></span></h4>
153160
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
154161
</div><h4 id='method.clone_from' class='method'><span id='clone_from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></span></h4>
155162
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
156-
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Drop.html' title='core::ops::Drop'>Drop</a> for <a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/arrayfire/array.rs.html#401-411' title='goto source code'>[src]</a></span></h3>
163+
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Drop.html' title='core::ops::Drop'>Drop</a> for <a class='struct' href='../arrayfire/struct.Array.html' title='arrayfire::Array'>Array</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/arrayfire/array.rs.html#408-418' title='goto source code'>[src]</a></span></h3>
157164
<div class='docblock'><p>To free resources when Array goes out of scope</p>
158165
</div><div class='impl-items'><h4 id='method.drop' class='method'><span id='drop.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code></span></h4>
159166
<div class='docblock'><p>A method called when the value goes out of scope. <a href="https://doc.rust-lang.org/nightly/core/ops/trait.Drop.html#tymethod.drop">Read more</a></p>

src/arrayfire/array.rs.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,13 @@
580580
<span id="536">536</span>
581581
<span id="537">537</span>
582582
<span id="538">538</span>
583+
<span id="539">539</span>
584+
<span id="540">540</span>
585+
<span id="541">541</span>
586+
<span id="542">542</span>
587+
<span id="543">543</span>
588+
<span id="544">544</span>
589+
<span id="545">545</span>
583590
</pre><pre class='rust '>
584591
<span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>libc</span>;
585592

@@ -879,7 +886,7 @@
879886

880887
<span class='doccomment'>/// Makes an copy of the Array</span>
881888
<span class='doccomment'>///</span>
882-
<span class='doccomment'>/// Internally, this is handled by reference counting</span>
889+
<span class='doccomment'>/// This does a deep copy of the data into a new Array</span>
883890
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>copy</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>Array</span> {
884891
<span class='kw'>unsafe</span> {
885892
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>temp</span>: <span class='ident'>i64</span> <span class='op'>=</span> <span class='number'>0</span>;
@@ -966,7 +973,14 @@
966973
}
967974
}
968975

969-
<span class='doccomment'>/// Used for incrementing the reference count of Array&#39;s native resource</span>
976+
<span class='doccomment'>/// Returns a new Array object after incrementing the reference count of native resource</span>
977+
<span class='doccomment'>///</span>
978+
<span class='doccomment'>/// Cloning an Array does not do a deep copy of the underlying array data. It increments the</span>
979+
<span class='doccomment'>/// reference count of native resource and returns you the new reference in the form a new Array</span>
980+
<span class='doccomment'>/// object.</span>
981+
<span class='doccomment'>///</span>
982+
<span class='doccomment'>/// To create a deep copy use</span>
983+
<span class='doccomment'>/// [copy()](http://arrayfire.org/arrayfire-rust/arrayfire/struct.Array.html#method.copy)</span>
970984
<span class='kw'>impl</span> <span class='ident'>Clone</span> <span class='kw'>for</span> <span class='ident'>Array</span> {
971985
<span class='kw'>fn</span> <span class='ident'>clone</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>Array</span> {
972986
<span class='kw'>unsafe</span> {

0 commit comments

Comments
 (0)