@@ -97,7 +97,7 @@ <h1 id='return-values-1' class='section-header'><a href='#return-values-1'>Retur
97
97
</ div > < h4 id ='method.copy ' class ='method '> < span id ='copy.v ' class ='invisible '> < code > fn < a href ='#method.copy ' class ='fnname '> copy</ a > (&self) -> < a class ='struct ' href ='../arrayfire/struct.Array.html ' title ='arrayfire::Array '> Array</ a > </ code > </ span > </ h4 >
98
98
< div class ='docblock '> < p > Makes an copy of the Array</ p >
99
99
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 >
101
101
</ 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 > (&self) -> < a class ='primitive ' href ='https://doc.rust-lang.org/nightly/std/primitive.bool.html '> bool</ a > </ code > </ span > </ h4 >
102
102
< div class ='docblock '> < p > Check if Array is empty</ p >
103
103
</ 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 > (&self) -> < 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
147
147
< div class ='docblock '> < p > Used for creating Array object from native resource id</ p >
148
148
</ 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 > ) -> < a class ='struct ' href ='../arrayfire/struct.Array.html ' title ='arrayfire::Array '> Array</ a > </ code > </ span > </ h4 >
149
149
< 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'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 >
152
159
</ 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 > (&self) -> < a class ='struct ' href ='../arrayfire/struct.Array.html ' title ='arrayfire::Array '> Array</ a > </ code > </ span > </ h4 >
153
160
< 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 >
154
161
</ 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 > (&mut self, source: &Self)</ code > < div class ='since ' title ='Stable since Rust version 1.0.0 '> 1.0.0</ div > </ span > </ h4 >
155
162
< 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 >
157
164
< div class ='docblock '> < p > To free resources when Array goes out of scope</ p >
158
165
</ 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 > (&mut self)</ code > </ span > </ h4 >
159
166
< 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 >
0 commit comments