diff --git a/.lock b/.lock new file mode 100755 index 0000000..e69de29 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/0.13.0/.lock b/0.13.0/.lock new file mode 100644 index 0000000..e69de29 diff --git a/0.13.0/crates.js b/0.13.0/crates.js new file mode 100644 index 0000000..7d9c1db --- /dev/null +++ b/0.13.0/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["soa_derive_example"]; \ No newline at end of file diff --git a/0.13.0/help.html b/0.13.0/help.html new file mode 100644 index 0000000..1e0988b --- /dev/null +++ b/0.13.0/help.html @@ -0,0 +1 @@ +
soa_derive
crate …","t":"DDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMLLLLLMMMMMMMMMMMMMMMMLLLLMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["Particle","ParticlePtr","ParticlePtrMut","ParticleRef","ParticleRefMut","ParticleSlice","ParticleSliceMut","ParticleVec","add","add","append","as_mut","as_mut","as_mut_ptr","as_mut_ptr","as_mut_ptr","as_mut_ptr","as_mut_slice","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ref","as_ref","as_ref","as_ref","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","capacity","clear","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","drop","eq","eq","eq","eq","eq","eq","eq","eq","first","first_mut","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from_iter","from_raw_parts","from_raw_parts","from_raw_parts_mut","get","get","get","get_mut","get_mut","get_unchecked","get_unchecked","get_unchecked","get_unchecked_mut","get_unchecked_mut","index","index","index","index_mut","index_mut","insert","into","into","into","into","into","into","into","into","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","is_empty","is_empty","is_empty","is_null","is_null","iter","iter","iter","iter_mut","iter_mut","kind","kind","kind","kind","kind","kind","kind","kind","last","last_mut","len","len","len","mass","mass","mass","mass","mass","mass","mass","mass","name","name","name","name","name","name","name","name","new","offset","offset","pop","position","position","position","position","position","position","position","position","push","read","read","read_unaligned","read_unaligned","read_volatile","read_volatile","reborrow","reborrow","remove","reserve","reserve_exact","retain","shrink_to_fit","slice","slice_mut","sort","sort_by","sort_by_key","split_at","split_at_mut","split_first","split_first_mut","split_last","split_last_mut","split_off","sub","sub","swap","swap_remove","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","truncate","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","with_capacity","wrapping_add","wrapping_add","wrapping_offset","wrapping_offset","wrapping_sub","wrapping_sub","write","write_unaligned","write_volatile"],"q":["soa_derive_example","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["A basic Particle type","An analog of a pointer to Particle
with struct of array …","An analog of a mutable pointer to Particle
with struct of …","A reference to a Particle
with struct of array layout.","A mutable reference to a Particle
with struct of array …","A slice of Particle
inside a ParticleVec
.","A mutable slice of Particle
inside a ParticleVec
.","An analog to Vec<Particle>\\n
with Struct of Array (SoA) …","Similar to *const T::add()
, with the same safety caveats.","Similar to *mut T::add()
, with the same safety caveats.","Similar to Vec<Particle> ::append()
.","Similar to *mut T::as_mut()
, with the same safety caveats.","Create a ParticleRefMut
from a mutably borrowed Particle
.","Similar to Vec<Particle> ::as_mut_ptr()
.","Convert a ParticleRefMut
to a ParticlePtrMut
; i.e. do a …","Convert a ParticlePtr
to a ParticlePtrMut
; i.e. do a …","Similar to &mut [Particle] ::as_mut_ptr()
.","Similar to Vec<Particle> ::as_mut_slice()
.","Similar to Vec<Particle> ::as_ptr()
.","Convert a ParticleRef
to a ParticlePtr
; i.e. do a …","Convert a ParticleRefMut
to a ParticlePtr
; i.e. do a …","Convert a ParticlePtrMut
to a ParticlePtr
; i.e. do a …","Similar to & [Particle] ::as_ptr()
.","Similar to & [Particle] ::as_ptr()
.","Similar to *const T::as_ref()
, with the same safety …","Similar to *mut T::as_ref()
, with the same safety caveats.","Convert a ParticleSliceMut
to a ParticleSlice
in order to …","Create a ParticleRef
from a borrowed Particle
.","Similar to Vec<Particle> ::as_slice()
.","Returns a non-mutable slice from this mutable slice.","","","","","","","","","","","","","","","","","Similar to Vec<Particle> ::capacity()
, the capacity of …","Similar to Vec<Particle> ::clear()
.","","","","","","","","","","","","","","","","","","Similar to & [Particle] ::first()
.","Similar to &mut [Particle] ::first_mut()
.","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Similar to Vec<Particle> ::from_raw_parts()
.","Similar to std::slice::from_raw_parts()
.","Similar to std::slice::from_raw_parts_mut()
.","Similar to Vec<Particle> ::get<I>()
.","Similar to & [Particle] ::get()
.","Similar to & [Particle] ::get()
.","Similar to Vec<Particle> ::get_mut<I>()
.","Similar to &mut [Particle] ::get_mut()
.","Similar to Vec<Particle> ::get_unchecked<I>()
.","Similar to & [Particle] ::get_unchecked()
.","Similar to & [Particle] ::get_unchecked()
.","Similar to Vec<Particle> ::get_unchecked_mut<I>()
.","Similar to &mut [Particle] ::get_unchecked_mut()
.","Similar to Vec<Particle> ::index<I>()
.","Similar to the std::ops::Index
trait for & [Particle]
. …","Similar to the std::ops::Index
trait for & [Particle]
. …","Similar to Vec<Particle> ::index_mut<I>()
.","Similar to the std::ops::IndexMut
trait for …","Similar to Vec<Particle> ::insert()
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","","","Get an iterator over the ParticleRef
in this slice.","","","Get a mutable iterator over the ParticleRefMut
in this …","Similar to Vec<Particle> ::is_empty()
, all the fields …","Similar to & [Particle] ::is_empty()
, the length of all …","Similar to & [Particle] ::is_empty()
, the length of all …","Similar to *const T::is_null()
.","Similar to *mut T::is_null()
.","Get an iterator over the ParticleRef
in this vector","Get an iterator over the ParticleRef
in this slice.","Get an iterator over the ParticleRef
in this vector","Get a mutable iterator over the ParticleRefMut
in this …","Get a mutable iterator over the ParticleRefMut
in this …","a vector of kind
from a Particle
","reference to the kind
field of a single Particle
inside a …","reference to the kind
field of a single Particle
inside a …","pointer to the kind
field of a single Particle
inside a …","pointer to the kind
field of a single Particle
inside a …","slice of kind
inside a ParticleVec
","slice of kind
inside a ParticleVec
","Kind of the particle","Similar to & [Particle] ::last()
.","Similar to &mut [Particle] ::last_mut()
.","Similar to Vec<Particle> ::len()
, all the fields should …","Similar to & [Particle] ::len()
, the length of all fields …","Similar to & [Particle] ::len()
, the length of all fields …","a vector of mass
from a Particle
","reference to the mass
field of a single Particle
inside a …","reference to the mass
field of a single Particle
inside a …","pointer to the mass
field of a single Particle
inside a …","pointer to the mass
field of a single Particle
inside a …","slice of mass
inside a ParticleVec
","slice of mass
inside a ParticleVec
","Mass of the particle","a vector of name
from a Particle
","reference to the name
field of a single Particle
inside a …","reference to the name
field of a single Particle
inside a …","pointer to the name
field of a single Particle
inside a …","pointer to the name
field of a single Particle
inside a …","slice of name
inside a ParticleVec
","slice of name
inside a ParticleVec
","Name of the particle","Similar to Vec<Particle> ::new()
","Similar to *const T::offset()
, with the same safety …","Similar to *mut T::offset()
, with the same safety caveats.","Similar to Vec<Particle> ::pop()
.","a vector of position
from a Particle
","reference to the position
field of a single Particle
…","reference to the position
field of a single Particle
…","pointer to the position
field of a single Particle
inside a","pointer to the position
field of a single Particle
inside a","slice of position
inside a ParticleVec
","slice of position
inside a ParticleVec
","Position of the particle","Similar to Vec<Particle> ::push()
.","Similar to *const T::read()
, with the same safety caveats.","Similar to *mut T::read()
, with the same safety caveats.","Similar to *const T::read_unaligned()
, with the same …","Similar to *mut T::read_unaligned()
, with the same safety …","Similar to *const T::read_volatile()
, with the same safety …","Similar to *mut T::read_volatile()
, with the same safety …","Reborrows the slices in a narrower lifetime","Reborrows the slices in a narrower lifetime","Similar to Vec<Particle> ::remove()
.","Similar to Vec<Particle> ::reserve()
, reserving the same …","Similar to Vec<Particle> ::reserve_exact()
reserving the …","Similar to Vec<Particle> ::retain()
.","Similar to Vec<Particle> ::shrink_to_fit()
shrinking all …","Create a slice of this vector matching the given range
. …","Create a mutable slice of this vector matching the given …","Similar to &mut [Particle] ::sort()
.","Similar to &mut [Particle] ::sort_by()
.","Similar to &mut [Particle] ::sort_by_key()
.","Similar to & [Particle] ::split_at()
.","Similar to &mut [Particle] ::split_at_mut()
.","Similar to & [Particle] ::split_first()
.","Similar to &mut [Particle] ::split_first_mut()
.","Similar to & [Particle] ::split_last()
.","Similar to &mut [Particle] ::last_mut()
.","Similar to Vec<Particle> ::split_off()
.","Similar to *const T::sub()
, with the same safety caveats.","Similar to *mut T::sub()
, with the same safety caveats.","Similar to &mut [Particle] ::swap()
.","Similar to Vec<Particle> ::swap_remove()
.","","Convert a reference to Particle
into an owned value. This …","Convert a mutable reference to Particle
into an owned …","","","","Similar to Vec<Particle> ::truncate()
truncating all …","","","","","","","","","","","","","","","","","","","","","","","","","Similar to Vec<Particle> ::with_capacity()
, initializing …","Similar to *const T::wrapping_add()
.","Similar to *mut T::wrapping_add()
, with the same safety …","Similar to *const T::offset()
.","Similar to *mut T::wrapping_offset()
","Similar to *const T::wrapping_sub()
.","Similar to *mut T::wrapping_sub()
, with the same safety …","Similar to *mut T::write()
, with the same safety caveats.","Similar to *mut T::write_unaligned()
, with the same safety …","Similar to *mut T::write_volatile()
, with the same safety …"],"i":[0,0,0,0,0,0,0,0,1,3,4,3,7,4,5,1,8,4,4,9,5,3,10,8,1,3,8,7,4,8,4,9,5,1,3,10,8,7,4,9,5,1,3,10,8,7,4,4,9,1,3,10,9,1,3,10,4,4,9,5,1,3,10,8,7,10,8,4,9,5,1,3,10,8,7,4,9,5,1,3,10,8,7,4,4,10,8,4,10,8,4,8,4,10,8,4,8,4,10,8,4,8,4,4,9,5,1,3,10,8,7,4,4,10,10,10,8,8,4,10,8,1,3,4,10,8,4,8,4,9,5,1,3,10,8,7,10,8,4,10,8,4,9,5,1,3,10,8,7,4,9,5,1,3,10,8,7,4,1,3,4,4,9,5,1,3,10,8,7,4,1,3,1,3,1,3,10,8,4,4,4,4,4,4,4,8,8,8,10,8,10,8,10,8,4,1,3,8,4,9,9,5,1,3,10,4,4,9,5,1,3,10,8,7,4,9,5,1,3,10,8,7,4,9,5,1,3,10,8,7,4,1,3,1,3,1,3,3,3,3],"f":[0,0,0,0,0,0,0,0,[[1,2],1],[[3,2],3],[[4,4]],[3,[[6,[5]]]],[7,5],[4,3],[5,3],[1,3],[8,3],[4,8],[4,1],[9,1],[5,1],[3,1],[10,1],[8,1],[1,[[6,[9]]]],[3,[[6,[9]]]],[8,10],[7,9],[4,10],[8,10],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[4,2],[4],[9,9],[1,1],[3,3],[10,10],[[]],[[]],[[]],[[]],[4],[[4,4],11],[[9,9],11],[[5,5],11],[[1,1],11],[[3,3],11],[[10,10],11],[[8,8],11],[[7,7],11],[10,[[6,[9]]]],[8,[[6,[5]]]],[[4,12],13],[[9,12],13],[[5,12],13],[[1,12],13],[[3,12],13],[[10,12],13],[[8,12],13],[[7,12],13],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[14,4],[[3,2,2],4],[[1,2],10],[[3,2],8],[4,6],[10,6],[8,6],[4,6],[8,6],[4],[10],[8],[4],[8],[4],[10],[8],[4],[8],[[4,2,7]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[4],[4],[10],0,[10],[8],0,[4,11],[10,11],[8,11],[1,11],[3,11],0,0,0,0,0,0,0,0,0,0,0,0,0,[10,[[6,[9]]]],[8,[[6,[5]]]],[4,2],[10,2],[8,2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[],4],[[1,15],1],[[3,15],3],[4,[[6,[7]]]],0,0,0,0,0,0,0,0,[[4,7]],[1,7],[3,7],[1,7],[3,7],[1,7],[3,7],[10,10],[8,8],[[4,2],7],[[4,2]],[[4,2]],[4],[4],[[4,[16,[2]]],10],[[4,[16,[2]]],8],[8],[8],[8],[[10,2]],[[8,2]],[10,6],[8,6],[10,6],[8,6],[[4,2],4],[[1,2],1],[[3,2],3],[[8,2,2]],[[4,2],7],[[]],[9,7],[5,7],[[]],[[]],[[]],[[4,2]],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[2,4],[[1,2],1],[[3,2],3],[[1,15],1],[[3,15],3],[[1,2],1],[[3,2],3],[[3,7]],[[3,7]],[[3,7]]],"p":[[3,"ParticlePtr"],[15,"usize"],[3,"ParticlePtrMut"],[3,"ParticleVec"],[3,"ParticleRefMut"],[4,"Option"],[3,"Particle"],[3,"ParticleSliceMut"],[3,"ParticleRef"],[3,"ParticleSlice"],[15,"bool"],[3,"Formatter"],[6,"Result"],[8,"IntoIterator"],[15,"isize"],[3,"Range"],[4,"Result"],[3,"TypeId"]]}\
+}');
+if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
+if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
diff --git a/0.13.0/settings.html b/0.13.0/settings.html
new file mode 100644
index 0000000..4f9161c
--- /dev/null
+++ b/0.13.0/settings.html
@@ -0,0 +1 @@
+This crate is an example for the soa_derive
crate functionalities. All
+the code is generated by a single file:
extern crate soa_derive;
+#[macro_use]
+use soa_derive::StructOfArray;
+
+/// A basic Particle type
+#[derive(Debug, PartialEq, StructOfArray)]
+#[soa_derive(Debug, PartialEq)]
+pub struct Particle {
+ /// Mass of the particle
+ pub mass: f64,
+ /// Position of the particle
+ pub position: [f64; 3],
+ /// Kind of the particle
+ pub kind: usize,
+ /// Name of the particle
+ pub name: String,
+}
Particle
+with struct of array layout.Particle
+with struct of array layout.Particle
+with struct of array layout.Particle
+with struct of array layout.Particle
+inside a
+ParticleVec
+.Particle
+inside a
+ParticleVec
+.Vec<Particle>
+
with Struct of Array (SoA) layoutpub struct Particle {
+ pub mass: f64,
+ pub position: [f64; 3],
+ pub kind: usize,
+ pub name: String,
+}
A basic Particle type
+mass: f64
Mass of the particle
+position: [f64; 3]
Position of the particle
+kind: usize
Kind of the particle
+name: String
Name of the particle
+Create a
+ParticleRef
+from a borrowed
+Particle
+.
Create a
+ParticleRefMut
+from a mutably borrowed
+Particle
+.
pub struct ParticlePtr {
+ pub mass: *const f64,
+ pub position: *const [f64; 3],
+ pub kind: *const usize,
+ pub name: *const String,
+}
An analog of a pointer to
+Particle
+with struct of array layout.
mass: *const f64
pointer to the mass
field of a single
+Particle
+inside a
+ParticleVec
position: *const [f64; 3]
pointer to the position
field of a single
+Particle
+inside a
+ParticleVec
kind: *const usize
pointer to the kind
field of a single
+Particle
+inside a
+ParticleVec
name: *const String
pointer to the name
field of a single
+Particle
+inside a
+ParticleVec
Convert a
+ParticlePtr
+to a
+ParticlePtrMut
+; i.e. do a *const T as *mut T
transformation.
Similar to *const T::is_null()
.
Similar to *const T::as_ref()
,
+with the same safety caveats.
Similar to *const T::offset()
,
+with the same safety caveats.
Similar to *const T::offset()
.
Similar to *const T::add()
,
+with the same safety caveats.
Similar to *const T::sub()
,
+with the same safety caveats.
Similar to *const T::wrapping_add()
.
Similar to *const T::wrapping_sub()
.
Similar to *const T::read()
,
+with the same safety caveats.
Similar to *const T::read_volatile()
,
+with the same safety caveats.
Similar to *const T::read_unaligned()
,
+with the same safety caveats.
source
. Read moreself
and other
values to be equal, and is used
+by ==
.pub struct ParticlePtrMut {
+ pub mass: *mut f64,
+ pub position: *mut [f64; 3],
+ pub kind: *mut usize,
+ pub name: *mut String,
+}
An analog of a mutable pointer to
+Particle
+with struct of array layout.
mass: *mut f64
pointer to the mass
field of a single
+Particle
+inside a
+ParticleVec
position: *mut [f64; 3]
pointer to the position
field of a single
+Particle
+inside a
+ParticleVec
kind: *mut usize
pointer to the kind
field of a single
+Particle
+inside a
+ParticleVec
name: *mut String
pointer to the name
field of a single
+Particle
+inside a
+ParticleVec
Convert a
+ParticlePtrMut
+to a
+ParticlePtr
+; i.e. do a *mut T as *const T
transformation
Similar to *mut T::is_null()
.
Similar to *mut T::as_ref()
,
+with the same safety caveats.
Similar to *mut T::as_mut()
,
+with the same safety caveats.
Similar to *mut T::offset()
,
+with the same safety caveats.
Similar to *mut T::wrapping_offset()
Similar to *mut T::add()
,
+with the same safety caveats.
Similar to *mut T::sub()
,
+with the same safety caveats.
Similar to *mut T::wrapping_add()
,
+with the same safety caveats.
Similar to *mut T::wrapping_sub()
,
+with the same safety caveats.
Similar to *mut T::read()
,
+with the same safety caveats.
Similar to *mut T::read_volatile()
,
+with the same safety caveats.
Similar to *mut T::read_unaligned()
,
+with the same safety caveats.
Similar to *mut T::write()
,
+with the same safety caveats.
Similar to *mut T::write_volatile()
,
+with the same safety caveats.
Similar to *mut T::write_unaligned()
,
+with the same safety caveats.
source
. Read moreself
and other
values to be equal, and is used
+by ==
.pub struct ParticleRef<'a> {
+ pub mass: &'a f64,
+ pub position: &'a [f64; 3],
+ pub kind: &'a usize,
+ pub name: &'a String,
+}
A reference to a
+Particle
+with struct of array layout.
mass: &'a f64
reference to the mass
field of a single
+Particle
+inside a
+ParticleVec
position: &'a [f64; 3]
reference to the position
field of a single
+Particle
+inside a
+ParticleVec
kind: &'a usize
reference to the kind
field of a single
+Particle
+inside a
+ParticleVec
name: &'a String
reference to the name
field of a single
+Particle
+inside a
+ParticleVec
Convert a
+ParticleRef
+to a
+ParticlePtr
+; i.e. do a &T as *const T
transformation
source
. Read moreself
and other
values to be equal, and is used
+by ==
.pub struct ParticleRefMut<'a> {
+ pub mass: &'a mut f64,
+ pub position: &'a mut [f64; 3],
+ pub kind: &'a mut usize,
+ pub name: &'a mut String,
+}
A mutable reference to a
+Particle
+with struct of array layout.
mass: &'a mut f64
reference to the mass
field of a single
+Particle
+inside a
+ParticleVec
position: &'a mut [f64; 3]
reference to the position
field of a single
+Particle
+inside a
+ParticleVec
kind: &'a mut usize
reference to the kind
field of a single
+Particle
+inside a
+ParticleVec
name: &'a mut String
reference to the name
field of a single
+Particle
+inside a
+ParticleVec
Convert a
+ParticleRefMut
+to a
+ParticlePtr
+; i.e. do a &mut T as *const T
transformation
Convert a
+ParticleRefMut
+to a
+ParticlePtrMut
+; i.e. do a &mut T as *mut T
transformation
self
and other
values to be equal, and is used
+by ==
.pub struct ParticleSlice<'a> {
+ pub mass: &'a [f64],
+ pub position: &'a [[f64; 3]],
+ pub kind: &'a [usize],
+ pub name: &'a [String],
+}
A slice of
+Particle
+inside a
+ParticleVec
+.
mass: &'a [f64]
slice of mass
inside a
+ParticleVec
position: &'a [[f64; 3]]
slice of position
inside a
+ParticleVec
kind: &'a [usize]
slice of kind
inside a
+ParticleVec
name: &'a [String]
slice of name
inside a
+ParticleVec
Get an iterator over the
+ParticleRef
+in this slice.
Get an iterator over the
+ParticleRef
+in this slice.
Similar to & [Particle] ::len()
,
+the length of all fields should be the same.
Similar to & [Particle] ::is_empty()
,
+the length of all fields should be the same.
Similar to & [Particle] ::first()
.
Similar to & [Particle] ::split_first()
.
Similar to & [Particle] ::last()
.
Similar to & [Particle] ::split_last()
.
Similar to & [Particle] ::split_at()
.
Similar to & [Particle] ::get()
.
Similar to & [Particle] ::get_unchecked()
.
Similar to the
+std::ops::Index
+trait for & [Particle]
.
+This is required because we cannot implement std::ops::Index
directly since it requires returning a reference.
Reborrows the slices in a narrower lifetime
+Similar to & [Particle] ::as_ptr()
.
Similar to std::slice::from_raw_parts()
.
source
. Read moreself
and other
values to be equal, and is used
+by ==
.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.pub struct ParticleSliceMut<'a> {
+ pub mass: &'a mut [f64],
+ pub position: &'a mut [[f64; 3]],
+ pub kind: &'a mut [usize],
+ pub name: &'a mut [String],
+}
A mutable slice of
+Particle
+inside a
+ParticleVec
+.
mass: &'a mut [f64]
slice of mass
inside a
+ParticleVec
position: &'a mut [[f64; 3]]
slice of position
inside a
+ParticleVec
kind: &'a mut [usize]
slice of kind
inside a
+ParticleVec
name: &'a mut [String]
slice of name
inside a
+ParticleVec
Get an iterator over the
+ParticleRef
+in this vector
Get a mutable iterator over the
+ParticleRefMut
+in this vector
Get a mutable iterator over the
+ParticleRefMut
+in this vector
Convert a
+ParticleSliceMut
+to a
+ParticleSlice
+in order to be able to use the methods on the non mutable
+version of the slices.
Similar to & [Particle] ::len()
,
+the length of all fields should be the same.
Similar to & [Particle] ::is_empty()
,
+the length of all fields should be the same.
Similar to &mut [Particle] ::first_mut()
.
Similar to &mut [Particle] ::split_first_mut()
.
The main difference is that this function consumes the slice.
+You should use Self::reborrow()
first if you want the
+returned values to have a shorter lifetime.
Similar to &mut [Particle] ::last_mut()
.
Similar to &mut [Particle] ::last_mut()
.
The main difference is that this function consumes the slice.
+You should use Self::reborrow()
first if you want the
+returned values to have a shorter lifetime.
Similar to &mut [Particle] ::split_at_mut()
.
The main difference is that this function consumes the slice.
+You should use Self::reborrow()
first if you want the
+returned values to have a shorter lifetime.
Similar to &mut [Particle] ::swap()
.
Similar to & [Particle] ::get()
.
Similar to & [Particle] ::get_unchecked()
.
Similar to the
+std::ops::Index
+trait for & [Particle]
.
+This is required because we cannot implement that trait.
Similar to &mut [Particle] ::get_mut()
.
Similar to &mut [Particle] ::get_unchecked_mut()
.
Similar to the
+std::ops::IndexMut
+trait for &mut [Particle]
.
+This is required because we cannot implement std::ops::IndexMut
directly since it requires returning a mutable reference.
Returns a non-mutable slice from this mutable slice.
+Reborrows the slices in a narrower lifetime
+Similar to & [Particle] ::as_ptr()
.
Similar to &mut [Particle] ::as_mut_ptr()
.
Similar to std::slice::from_raw_parts_mut()
.
Similar to &mut [Particle] ::sort_by()
.
Similar to &mut [Particle] ::sort_by_key()
.
Similar to &mut [Particle] ::sort()
.
self
and other
values to be equal, and is used
+by ==
.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.pub struct ParticleVec {
+ pub mass: Vec<f64>,
+ pub position: Vec<[f64; 3]>,
+ pub kind: Vec<usize>,
+ pub name: Vec<String>,
+}
An analog to Vec<Particle>
+
with Struct of Array (SoA) layout
mass: Vec<f64>
a vector of mass
from a
+Particle
position: Vec<[f64; 3]>
a vector of position
from a
+Particle
kind: Vec<usize>
a vector of kind
from a
+Particle
name: Vec<String>
a vector of name
from a
+Particle
Get an iterator over the
+ParticleRef
+in this vector
Get a mutable iterator over the
+ParticleRefMut
+in this vector
Similar to Vec<Particle> ::new()
Similar to Vec<Particle> ::with_capacity()
,
+initializing all fields with the given capacity
.
Similar to Vec<Particle> ::capacity()
,
+the capacity of all fields should be the same.
Similar to Vec<Particle> ::reserve()
,
+reserving the same additional
space for all fields.
Similar to Vec<Particle> ::reserve_exact()
+reserving the same additional
space for all fields.
Similar to Vec<Particle> ::shrink_to_fit()
+shrinking all fields.
Similar to Vec<Particle> ::truncate()
+truncating all fields.
Similar to Vec<Particle> ::push()
.
Similar to Vec<Particle> ::len()
,
+all the fields should have the same length.
Similar to Vec<Particle> ::is_empty()
,
+all the fields should have the same length.
Similar to Vec<Particle> ::swap_remove()
.
Similar to Vec<Particle> ::insert()
.
Similar to Vec<Particle> ::remove()
.
Similar to Vec<Particle> ::pop()
.
Similar to Vec<Particle> ::append()
.
Similar to Vec<Particle> ::clear()
.
Similar to Vec<Particle> ::split_off()
.
Similar to Vec<Particle> ::as_slice()
.
Similar to Vec<Particle> ::as_mut_slice()
.
Create a slice of this vector matching the given range
. This
+is analogous to Index<Range<usize>>
.
Create a mutable slice of this vector matching the given
+range
. This is analogous to IndexMut<Range<usize>>
.
Similar to Vec<Particle> ::retain()
.
Similar to Vec<Particle> ::get<I>()
.
Similar to Vec<Particle> ::get_unchecked<I>()
.
Similar to Vec<Particle> ::index<I>()
.
Similar to Vec<Particle> ::get_mut<I>()
.
Similar to Vec<Particle> ::get_unchecked_mut<I>()
.
Similar to Vec<Particle> ::index_mut<I>()
.
Similar to Vec<Particle> ::as_ptr()
.
Similar to Vec<Particle> ::as_mut_ptr()
.
Similar to Vec<Particle> ::from_raw_parts()
.
self
and other
values to be equal, and is used
+by ==
.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +
//! This crate is an example for the [`soa_derive`] crate functionalities. All
+//! the code is generated by a single file:
+//!
+//! ```no_run
+//! extern crate soa_derive;
+//! # mod particle {
+//! #[macro_use]
+//! use soa_derive::StructOfArray;
+//!
+//! /// A basic Particle type
+//! #[derive(Debug, PartialEq, StructOfArray)]
+//! #[soa_derive(Debug, PartialEq)]
+//! pub struct Particle {
+//! /// Mass of the particle
+//! pub mass: f64,
+//! /// Position of the particle
+//! pub position: [f64; 3],
+//! /// Kind of the particle
+//! pub kind: usize,
+//! /// Name of the particle
+//! pub name: String,
+//! }
+//! # }
+//! ```
+//!
+//! [`soa_derive`]: https://github.com/lumol-org/soa-derive/
+
+// Deny most of allow by default lints, just to be sure we don't create warning in user code.
+// They are to be selectively allowed in the implementation
+#![deny(absolute_paths_not_starting_with_crate, anonymous_parameters, bare_trait_objects)]
+#![deny(box_pointers, missing_copy_implementations, missing_debug_implementations)]
+#![deny(missing_docs, trivial_casts, trivial_numeric_casts, unreachable_pub)]
+#![deny(unstable_features, unused_extern_crates, unused_import_braces, unused_labels)]
+#![deny(unused_lifetimes, unused_qualifications, unused_results, variant_size_differences)]
+
+// Other allow by default lints that need to stay allowed
+#![allow(unsafe_code, single_use_lifetimes, elided_lifetimes_in_paths)]
+
+#![deny(warnings)]
+
+#[macro_use]
+extern crate soa_derive;
+
+/// A basic Particle type
+#[derive(Debug, PartialEq, StructOfArray)]
+#[soa_derive(Debug, PartialEq)]
+pub struct Particle {
+ /// Mass of the particle
+ pub mass: f64,
+ /// Position of the particle
+ pub position: [f64; 3],
+ /// Kind of the particle
+ pub kind: usize,
+ /// Name of the particle
+ pub name: String,
+}
+
fn:
) to \
+ restrict the search to a given item kind.","Accepted kinds are: fn
, mod
, struct
, \
+ enum
, trait
, type
, macro
, \
+ and const
.","Search functions by type signature (e.g., vec -> usize
or \
+ -> vec
)","Search multiple things at once by splitting your query with comma (e.g., \
+ str,u8
or String,struct:Vec,test
)","You can look for items with an exact name by putting double quotes around \
+ your request: \"string\"
","Look for items inside another one by searching for a path: vec::Vec
",].map(x=>""+x+"
").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="${value}
`}else{error[index]=value}});output+=`soa_derive
crate …","t":"FFFFFFFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOONNNNNOOOOOOOOOOOOOOOONNNNOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","n":["Particle","ParticlePtr","ParticlePtrMut","ParticleRef","ParticleRefMut","ParticleSlice","ParticleSliceMut","ParticleVec","add","add","append","as_mut","as_mut","as_mut_ptr","as_mut_ptr","as_mut_ptr","as_mut_ptr","as_mut_slice","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ptr","as_ref","as_ref","as_ref","as_ref","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","capacity","clear","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","default","default","default","drop","eq","eq","eq","eq","eq","eq","eq","eq","extend","extend","first","first_mut","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from_iter","from_raw_parts","from_raw_parts","from_raw_parts_mut","get","get","get","get_mut","get_mut","get_unchecked","get_unchecked","get_unchecked","get_unchecked_mut","get_unchecked_mut","index","index","index","index_mut","index_mut","insert","into","into","into","into","into","into","into","into","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","is_empty","is_empty","is_empty","is_null","is_null","iter","iter","iter","iter_mut","iter_mut","kind","kind","kind","kind","kind","kind","kind","kind","last","last_mut","len","len","len","mass","mass","mass","mass","mass","mass","mass","mass","name","name","name","name","name","name","name","name","new","offset","offset","pop","position","position","position","position","position","position","position","position","push","read","read","read_unaligned","read_unaligned","read_volatile","read_volatile","reborrow","reborrow","remove","replace","replace","reserve","reserve_exact","retain","retain_mut","shrink_to_fit","slice","slice_mut","sort","sort_by","sort_by_key","split_at","split_at_mut","split_first","split_first_mut","split_last","split_last_mut","split_off","sub","sub","swap","swap_remove","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","truncate","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","with_capacity","wrapping_add","wrapping_add","wrapping_offset","wrapping_offset","wrapping_sub","wrapping_sub","write","write_unaligned","write_volatile"],"q":[[0,"soa_derive_example"],[248,"core::option"],[249,"core::iter::traits::collect"],[250,"core::fmt"],[251,"core::fmt"],[252,"soa_derive"],[253,"core::ops::range"],[254,"core::cmp"],[255,"core::cmp"],[256,"core::any"]],"d":["A basic Particle type","An analog of a pointer to Particle
with struct of array …","An analog of a mutable pointer to Particle
with struct of …","A reference to a Particle
with struct of array layout.","A mutable reference to a Particle
with struct of array …","A slice of Particle
inside a ParticleVec
.","A mutable slice of Particle
inside a ParticleVec
.","An analog to Vec<Particle>\\n
with Struct of Array (SoA) …","Similar to *const T::add()
, with the same safety caveats.","Similar to *mut T::add()
, with the same safety caveats.","Similar to Vec<Particle> ::append()
.","Similar to *mut T::as_mut()
, with the same safety caveats.","Create a ParticleRefMut
from a mutably borrowed Particle
.","Similar to Vec<Particle> ::as_mut_ptr()
.","Convert a ParticleRefMut
to a ParticlePtrMut
; i.e. do a …","Convert a ParticlePtr
to a ParticlePtrMut
; i.e. do a …","Similar to &mut [Particle] ::as_mut_ptr()
.","Similar to Vec<Particle> ::as_mut_slice()
.","Similar to Vec<Particle> ::as_ptr()
.","Convert a ParticleRef
to a ParticlePtr
; i.e. do a …","Convert a ParticleRefMut
to a ParticlePtr
; i.e. do a …","Convert a ParticlePtrMut
to a ParticlePtr
; i.e. do a …","Similar to & [Particle] ::as_ptr()
.","Similar to & [Particle] ::as_ptr()
.","Similar to *const T::as_ref()
, with the same safety …","Similar to *mut T::as_ref()
, with the same safety caveats.","Convert a ParticleSliceMut
to a ParticleSlice
in order to …","Create a ParticleRef
from a borrowed Particle
.","Similar to Vec<Particle> ::as_slice()
.","Returns a non-mutable slice from this mutable slice.","","","","","","","","","","","","","","","","","Similar to Vec<Particle> ::capacity()
, the capacity of …","Similar to Vec<Particle> ::clear()
.","","","","","","","","","","","","","","","","","","","","","","","Similar to & [Particle] ::first()
.","Similar to &mut [Particle] ::first_mut()
.","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Similar to Vec<Particle> ::from_raw_parts()
.","Similar to std::slice::from_raw_parts()
.","Similar to std::slice::from_raw_parts_mut()
.","Similar to Vec<Particle> ::get<I>()
.","Similar to & [Particle] ::get()
.","Similar to & [Particle] ::get()
.","Similar to Vec<Particle> ::get_mut<I>()
.","Similar to &mut [Particle] ::get_mut()
.","Similar to Vec<Particle> ::get_unchecked<I>()
.","Similar to & [Particle] ::get_unchecked()
.","Similar to & [Particle] ::get_unchecked()
.","Similar to Vec<Particle> ::get_unchecked_mut<I>()
.","Similar to &mut [Particle] ::get_unchecked_mut()
.","Similar to Vec<Particle> ::index<I>()
.","Similar to the std::ops::Index
trait for & [Particle]
. …","Similar to the std::ops::Index
trait for & [Particle]
. …","Similar to Vec<Particle> ::index_mut<I>()
.","Similar to the std::ops::IndexMut
trait for …","Similar to Vec<Particle> ::insert()
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","","","","Get an iterator over the ParticleRef
in this slice.","","Get a mutable iterator over the ParticleRefMut
in this …","Similar to Vec<Particle> ::is_empty()
, all the fields …","Similar to & [Particle] ::is_empty()
, the length of all …","Similar to & [Particle] ::is_empty()
, the length of all …","Similar to *const T::is_null()
.","Similar to *mut T::is_null()
.","Get an iterator over the ParticleRef
in this vector","Get an iterator over the ParticleRef
in this slice.","Get an iterator over the ParticleRef
in this vector","Get a mutable iterator over the ParticleRefMut
in this …","Get a mutable iterator over the ParticleRefMut
in this …","a vector of kind
from a Particle
","reference to the kind
field of a single Particle
inside a …","reference to the kind
field of a single Particle
inside a …","pointer to the kind
field of a single Particle
inside a …","pointer to the kind
field of a single Particle
inside a …","slice of kind
inside a ParticleVec
","slice of kind
inside a ParticleVec
","Kind of the particle","Similar to & [Particle] ::last()
.","Similar to &mut [Particle] ::last_mut()
.","Similar to Vec<Particle> ::len()
, all the fields should …","Similar to & [Particle] ::len()
, the length of all fields …","Similar to & [Particle] ::len()
, the length of all fields …","a vector of mass
from a Particle
","reference to the mass
field of a single Particle
inside a …","reference to the mass
field of a single Particle
inside a …","pointer to the mass
field of a single Particle
inside a …","pointer to the mass
field of a single Particle
inside a …","slice of mass
inside a ParticleVec
","slice of mass
inside a ParticleVec
","Mass of the particle","a vector of name
from a Particle
","reference to the name
field of a single Particle
inside a …","reference to the name
field of a single Particle
inside a …","pointer to the name
field of a single Particle
inside a …","pointer to the name
field of a single Particle
inside a …","slice of name
inside a ParticleVec
","slice of name
inside a ParticleVec
","Name of the particle","Similar to Vec<Particle> ::new()
","Similar to *const T::offset()
, with the same safety …","Similar to *mut T::offset()
, with the same safety caveats.","Similar to Vec<Particle> ::pop()
.","a vector of position
from a Particle
","reference to the position
field of a single Particle
…","reference to the position
field of a single Particle
…","pointer to the position
field of a single Particle
inside a","pointer to the position
field of a single Particle
inside a","slice of position
inside a ParticleVec
","slice of position
inside a ParticleVec
","Position of the particle","Similar to Vec<Particle> ::push()
.","Similar to *const T::read()
, with the same safety caveats.","Similar to *mut T::read()
, with the same safety caveats.","Similar to *const T::read_unaligned()
, with the same …","Similar to *mut T::read_unaligned()
, with the same safety …","Similar to *const T::read_volatile()
, with the same safety …","Similar to *mut T::read_volatile()
, with the same safety …","Reborrows the slices in a narrower lifetime","Reborrows the slices in a narrower lifetime","Similar to Vec<Particle> ::remove()
.","Similar to std::mem::replace()
.","Similar to std::mem::replace()
.","Similar to Vec<Particle> ::reserve()
, reserving the same …","Similar to Vec<Particle> ::reserve_exact()
reserving the …","Similar to Vec<Particle> ::retain()
.","Similar to Vec<Particle> ::retain_mut()
.","Similar to Vec<Particle> ::shrink_to_fit()
shrinking all …","Create a slice of this vector matching the given range
. …","Create a mutable slice of this vector matching the given …","Similar to &mut [Particle] ::sort()
.","Similar to &mut [Particle] ::sort_by()
.","Similar to &mut [Particle] ::sort_by_key()
.","Similar to & [Particle] ::split_at()
.","Similar to &mut [Particle] ::split_at_mut()
.","Similar to & [Particle] ::split_first()
.","Similar to &mut [Particle] ::split_first_mut()
.","Similar to & [Particle] ::split_last()
.","Similar to &mut [Particle] ::last_mut()
.","Similar to Vec<Particle> ::split_off()
.","Similar to *const T::sub()
, with the same safety caveats.","Similar to *mut T::sub()
, with the same safety caveats.","Similar to &mut [Particle] ::swap()
.","Similar to Vec<Particle> ::swap_remove()
.","Convert a reference to Particle
into an owned value. This …","","Convert a mutable reference to Particle
into an owned …","","","","Similar to Vec<Particle> ::truncate()
truncating all …","","","","","","","","","","","","","","","","","","","","","","","","","Similar to Vec<Particle> ::with_capacity()
, initializing …","Similar to *const T::wrapping_add()
.","Similar to *mut T::wrapping_add()
, with the same safety …","Similar to *const T::offset()
.","Similar to *mut T::wrapping_offset()
","Similar to *const T::wrapping_sub()
.","Similar to *mut T::wrapping_sub()
, with the same safety …","Similar to *mut T::write()
, with the same safety caveats.","Similar to *mut T::write_unaligned()
, with the same safety …","Similar to *mut T::write_volatile()
, with the same safety …"],"i":[0,0,0,0,0,0,0,0,1,3,4,3,8,4,6,1,9,4,4,10,6,3,11,9,1,3,9,8,4,9,4,10,6,1,3,11,9,8,4,10,6,1,3,11,9,8,4,4,10,1,3,11,10,1,3,11,4,11,9,4,4,10,6,1,3,11,9,8,4,4,11,9,4,10,6,1,3,11,9,8,4,10,6,1,3,11,9,8,4,4,11,9,4,11,9,4,9,4,11,9,4,9,4,11,9,4,9,4,4,10,6,1,3,11,9,8,4,4,11,11,11,9,9,4,11,9,1,3,4,11,9,4,9,4,10,6,1,3,11,9,8,11,9,4,11,9,4,10,6,1,3,11,9,8,4,10,6,1,3,11,9,8,4,1,3,4,4,10,6,1,3,11,9,8,4,1,3,1,3,1,3,11,9,4,4,6,4,4,4,4,4,4,4,9,9,9,11,9,11,9,11,9,4,1,3,9,4,10,10,6,1,3,11,4,4,10,6,1,3,11,9,8,4,10,6,1,3,11,9,8,4,10,6,1,3,11,9,8,4,1,3,1,3,1,3,3,3,3],"f":"````````{{bd}b}{{fd}f}{{hh}j}{f{{n{l}}}}{A`l}{hf}{lf}{bf}{Abf}{hAb}{hb}{Adb}{lb}{fb}{Afb}{Abb}{b{{n{Ad}}}}{f{{n{Ad}}}}{AbAf}{A`Ad}{hAf}2{ce{}{}}000000000000000{hd}{hj}{AdAd}{bb}{ff}{AfAf}{{ce}j{}{}}000{{}h}{{}Af}{{}Ab}8{{hh}Ah}{{AdAd}Ah}{{ll}Ah}{{bb}Ah}{{ff}Ah}{{AfAf}Ah}{{AbAb}Ah}{{A`A`}Ah}{{hc}j{{Al{}{{Aj{Ad}}}}}}{{hc}j{{Al{}{{Aj{A`}}}}}}{Af{{n{Ad}}}}{Ab{{n{l}}}}{{hAn}B`}{{AdAn}B`}{{lAn}B`}{{bAn}B`}{{fAn}B`}{{AfAn}B`}{{AbAn}B`}{{A`An}B`}{cc{}}0000000{ch{{Al{}{{Aj{A`}}}}}}{{fdd}h}{{bd}Af}{{fd}Ab}{{hc}n{{Bb{h}}}}{{Afc}n{{Bb{Af}}}}{{Abc}n{{Bb{Af}}}}{{hc}n{{Bd{h}}}}{{Abc}n{{Bd{Ab}}}}{{hc}{}{{Bb{h}}}}{{Afc}{}{{Bb{Af}}}}{{Abc}{}{{Bb{Af}}}}{{hc}{}{{Bd{h}}}}{{Abc}{}{{Bd{Ab}}}}43210{{hdA`}j}{ce{}{}}0000000{hc{}}0{Afc{}}0`{Abc{}}`{hAh}{AfAh}{AbAh}{bAh}{fAh}`````````````{Af{{n{Ad}}}}{Ab{{n{l}}}}{hd}{Afd}{Abd}````````````````{{}h}{{bBf}b}{{fBf}f}{h{{n{A`}}}}````````{{hA`}j}{bA`}{fA`}1010{AfAf}{AbAb}{{hd}A`}{{hdA`}A`}{{lA`}A`}{{hd}j}0{{hc}j{{Bj{Ad}{{Bh{Ah}}}}}}{{hc}j{{Bj{l}{{Bh{Ah}}}}}}{hj}{{h{Bl{d}}}Af}{{h{Bl{d}}}Ab}{Abj}{{Abc}j{{Bj{AdAd}{{Bh{Bn}}}}}}{{Abe}jC`{{Bj{Ad}{{Bh{c}}}}}}{{Afd}{{Cb{AfAf}}}}{{Abd}{{Cb{AbAb}}}}{Af{{n{{Cb{AdAf}}}}}}{Ab{{n{{Cb{lAb}}}}}}10{{hd}h}{{bd}b}{{fd}f}{{Abdd}j}{{hd}A`}{AdA`}{ce{}{}}{lA`}111{{hd}j}{c{{Cd{e}}}{}{}}000000000000000{cCf{}}0000000{dh}:9{{bBf}b}{{fBf}f}<;{{fA`}j}00","c":[],"p":[[5,"ParticlePtr",0],[1,"usize"],[5,"ParticlePtrMut",0],[5,"ParticleVec",0],[1,"unit"],[5,"ParticleRefMut",0],[6,"Option",248],[5,"Particle",0],[5,"ParticleSliceMut",0],[5,"ParticleRef",0],[5,"ParticleSlice",0],[1,"bool"],[17,"Item"],[10,"IntoIterator",249],[5,"Formatter",250],[8,"Result",250],[10,"SoAIndex",251],[10,"SoAIndexMut",251],[1,"isize"],[17,"Output"],[10,"FnMut",252],[5,"Range",253],[6,"Ordering",254],[10,"Ord",254],[1,"tuple"],[6,"Result",255],[5,"TypeId",256]],"b":[[68,"impl-Extend%3CParticleRef%3C\'a%3E%3E-for-ParticleVec"],[69,"impl-Extend%3CParticle%3E-for-ParticleVec"],[116,"impl-IntoIterator-for-%26ParticleVec"],[117,"impl-IntoIterator-for-%26mut+ParticleVec"],[118,"impl-IntoIterator-for-ParticleSlice%3C\'a%3E"],[119,"impl-IntoIterator-for-%26ParticleSlice%3C\'b%3E"],[120,"impl-ParticleSlice%3C\'a%3E"],[121,"impl-IntoIterator-for-ParticleSliceMut%3C\'a%3E"],[122,"impl-ParticleSliceMut%3C\'a%3E"]]}]\
+]'));
+if (typeof exports !== 'undefined') exports.searchIndex = searchIndex;
+else if (window.initSearch) window.initSearch(searchIndex);
diff --git a/latest/settings.html b/latest/settings.html
new file mode 100644
index 0000000..46615e3
--- /dev/null
+++ b/latest/settings.html
@@ -0,0 +1,2 @@
+This crate is an example for the soa_derive
crate functionalities. All
+the code is generated by a single file:
extern crate soa_derive;
+#[macro_use]
+use soa_derive::StructOfArray;
+
+/// A basic Particle type
+#[derive(Debug, PartialEq, StructOfArray)]
+#[soa_derive(Debug, PartialEq)]
+pub struct Particle {
+ /// Mass of the particle
+ pub mass: f64,
+ /// Position of the particle
+ pub position: [f64; 3],
+ /// Kind of the particle
+ pub kind: usize,
+ /// Name of the particle
+ pub name: String,
+}
Particle
+with struct of array layout.Particle
+with struct of array layout.Particle
+with struct of array layout.Particle
+with struct of array layout.Particle
+inside a
+ParticleVec
+.Particle
+inside a
+ParticleVec
+.Vec<Particle>
+
with Struct of Array (SoA) layoutpub struct Particle {
+ pub mass: f64,
+ pub position: [f64; 3],
+ pub kind: usize,
+ pub name: String,
+}
A basic Particle type
+mass: f64
Mass of the particle
+position: [f64; 3]
Position of the particle
+kind: usize
Kind of the particle
+name: String
Name of the particle
+Create a
+ParticleRef
+from a borrowed
+Particle
+.
Create a
+ParticleRefMut
+from a mutably borrowed
+Particle
+.
extend_one
)extend_one
)pub struct ParticlePtr {
+ pub mass: *const f64,
+ pub position: *const [f64; 3],
+ pub kind: *const usize,
+ pub name: *const String,
+}
An analog of a pointer to
+Particle
+with struct of array layout.
mass: *const f64
pointer to the mass
field of a single
+Particle
+inside a
+ParticleVec
position: *const [f64; 3]
pointer to the position
field of a single
+Particle
+inside a
+ParticleVec
kind: *const usize
pointer to the kind
field of a single
+Particle
+inside a
+ParticleVec
name: *const String
pointer to the name
field of a single
+Particle
+inside a
+ParticleVec
Convert a
+ParticlePtr
+to a
+ParticlePtrMut
+; i.e. do a *const T as *mut T
transformation.
Similar to *const T::is_null()
.
Similar to *const T::as_ref()
,
+with the same safety caveats.
Similar to *const T::offset()
,
+with the same safety caveats.
Similar to *const T::offset()
.
Similar to *const T::add()
,
+with the same safety caveats.
Similar to *const T::sub()
,
+with the same safety caveats.
Similar to *const T::wrapping_add()
.
Similar to *const T::wrapping_sub()
.
Similar to *const T::read()
,
+with the same safety caveats.
Similar to *const T::read_volatile()
,
+with the same safety caveats.
Similar to *const T::read_unaligned()
,
+with the same safety caveats.
source
. Read moreself
and other
values to be equal, and is used
+by ==
.pub struct ParticlePtrMut {
+ pub mass: *mut f64,
+ pub position: *mut [f64; 3],
+ pub kind: *mut usize,
+ pub name: *mut String,
+}
An analog of a mutable pointer to
+Particle
+with struct of array layout.
mass: *mut f64
pointer to the mass
field of a single
+Particle
+inside a
+ParticleVec
position: *mut [f64; 3]
pointer to the position
field of a single
+Particle
+inside a
+ParticleVec
kind: *mut usize
pointer to the kind
field of a single
+Particle
+inside a
+ParticleVec
name: *mut String
pointer to the name
field of a single
+Particle
+inside a
+ParticleVec
Convert a
+ParticlePtrMut
+to a
+ParticlePtr
+; i.e. do a *mut T as *const T
transformation
Similar to *mut T::is_null()
.
Similar to *mut T::as_ref()
,
+with the same safety caveats.
Similar to *mut T::as_mut()
,
+with the same safety caveats.
Similar to *mut T::offset()
,
+with the same safety caveats.
Similar to *mut T::wrapping_offset()
Similar to *mut T::add()
,
+with the same safety caveats.
Similar to *mut T::sub()
,
+with the same safety caveats.
Similar to *mut T::wrapping_add()
,
+with the same safety caveats.
Similar to *mut T::wrapping_sub()
,
+with the same safety caveats.
Similar to *mut T::read()
,
+with the same safety caveats.
Similar to *mut T::read_volatile()
,
+with the same safety caveats.
Similar to *mut T::read_unaligned()
,
+with the same safety caveats.
Similar to *mut T::write()
,
+with the same safety caveats.
Similar to *mut T::write_volatile()
,
+with the same safety caveats.
Similar to *mut T::write_unaligned()
,
+with the same safety caveats.
source
. Read moreself
and other
values to be equal, and is used
+by ==
.pub struct ParticleRef<'a> {
+ pub mass: &'a f64,
+ pub position: &'a [f64; 3],
+ pub kind: &'a usize,
+ pub name: &'a String,
+}
A reference to a
+Particle
+with struct of array layout.
mass: &'a f64
reference to the mass
field of a single
+Particle
+inside a
+ParticleVec
position: &'a [f64; 3]
reference to the position
field of a single
+Particle
+inside a
+ParticleVec
kind: &'a usize
reference to the kind
field of a single
+Particle
+inside a
+ParticleVec
name: &'a String
reference to the name
field of a single
+Particle
+inside a
+ParticleVec
Convert a
+ParticleRef
+to a
+ParticlePtr
+; i.e. do a &T as *const T
transformation
source
. Read moreextend_one
)extend_one
)self
and other
values to be equal, and is used
+by ==
.pub struct ParticleRefMut<'a> {
+ pub mass: &'a mut f64,
+ pub position: &'a mut [f64; 3],
+ pub kind: &'a mut usize,
+ pub name: &'a mut String,
+}
A mutable reference to a
+Particle
+with struct of array layout.
mass: &'a mut f64
reference to the mass
field of a single
+Particle
+inside a
+ParticleVec
position: &'a mut [f64; 3]
reference to the position
field of a single
+Particle
+inside a
+ParticleVec
kind: &'a mut usize
reference to the kind
field of a single
+Particle
+inside a
+ParticleVec
name: &'a mut String
reference to the name
field of a single
+Particle
+inside a
+ParticleVec
Convert a
+ParticleRefMut
+to a
+ParticlePtr
+; i.e. do a &mut T as *const T
transformation
Convert a
+ParticleRefMut
+to a
+ParticlePtrMut
+; i.e. do a &mut T as *mut T
transformation
self
and other
values to be equal, and is used
+by ==
.pub struct ParticleSlice<'a> {
+ pub mass: &'a [f64],
+ pub position: &'a [[f64; 3]],
+ pub kind: &'a [usize],
+ pub name: &'a [String],
+}
A slice of
+Particle
+inside a
+ParticleVec
+.
mass: &'a [f64]
slice of mass
inside a
+ParticleVec
position: &'a [[f64; 3]]
slice of position
inside a
+ParticleVec
kind: &'a [usize]
slice of kind
inside a
+ParticleVec
name: &'a [String]
slice of name
inside a
+ParticleVec
Get an iterator over the
+ParticleRef
+in this slice.
Get an iterator over the
+ParticleRef
+in this slice.
Similar to & [Particle] ::len()
,
+the length of all fields should be the same.
Similar to & [Particle] ::is_empty()
,
+the length of all fields should be the same.
Similar to & [Particle] ::first()
.
Similar to & [Particle] ::split_first()
.
Similar to & [Particle] ::last()
.
Similar to & [Particle] ::split_last()
.
Similar to & [Particle] ::split_at()
.
Similar to & [Particle] ::get()
.
Similar to & [Particle] ::get_unchecked()
.
Similar to the
+std::ops::Index
+trait for & [Particle]
.
+This is required because we cannot implement std::ops::Index
directly since it requires returning a reference.
Reborrows the slices in a narrower lifetime
+Similar to & [Particle] ::as_ptr()
.
Similar to std::slice::from_raw_parts()
.
source
. Read moreself
and other
values to be equal, and is used
+by ==
.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.pub struct ParticleSliceMut<'a> {
+ pub mass: &'a mut [f64],
+ pub position: &'a mut [[f64; 3]],
+ pub kind: &'a mut [usize],
+ pub name: &'a mut [String],
+}
A mutable slice of
+Particle
+inside a
+ParticleVec
+.
mass: &'a mut [f64]
slice of mass
inside a
+ParticleVec
position: &'a mut [[f64; 3]]
slice of position
inside a
+ParticleVec
kind: &'a mut [usize]
slice of kind
inside a
+ParticleVec
name: &'a mut [String]
slice of name
inside a
+ParticleVec
Get an iterator over the
+ParticleRef
+in this vector
Get a mutable iterator over the
+ParticleRefMut
+in this vector
Get a mutable iterator over the
+ParticleRefMut
+in this vector
Convert a
+ParticleSliceMut
+to a
+ParticleSlice
+in order to be able to use the methods on the non mutable
+version of the slices.
Similar to & [Particle] ::len()
,
+the length of all fields should be the same.
Similar to & [Particle] ::is_empty()
,
+the length of all fields should be the same.
Similar to &mut [Particle] ::first_mut()
.
Similar to &mut [Particle] ::split_first_mut()
.
The main difference is that this function consumes the slice.
+You should use Self::reborrow()
first if you want the
+returned values to have a shorter lifetime.
Similar to &mut [Particle] ::last_mut()
.
Similar to &mut [Particle] ::last_mut()
.
The main difference is that this function consumes the slice.
+You should use Self::reborrow()
first if you want the
+returned values to have a shorter lifetime.
Similar to &mut [Particle] ::split_at_mut()
.
The main difference is that this function consumes the slice.
+You should use Self::reborrow()
first if you want the
+returned values to have a shorter lifetime.
Similar to &mut [Particle] ::swap()
.
Similar to & [Particle] ::get()
.
Similar to & [Particle] ::get_unchecked()
.
Similar to the
+std::ops::Index
+trait for & [Particle]
.
+This is required because we cannot implement that trait.
Similar to &mut [Particle] ::get_mut()
.
Similar to &mut [Particle] ::get_unchecked_mut()
.
Similar to the
+std::ops::IndexMut
+trait for &mut [Particle]
.
+This is required because we cannot implement std::ops::IndexMut
directly since it requires returning a mutable reference.
Returns a non-mutable slice from this mutable slice.
+Reborrows the slices in a narrower lifetime
+Similar to & [Particle] ::as_ptr()
.
Similar to &mut [Particle] ::as_mut_ptr()
.
Similar to std::slice::from_raw_parts_mut()
.
Similar to &mut [Particle] ::sort_by()
.
Similar to &mut [Particle] ::sort_by_key()
.
Similar to &mut [Particle] ::sort()
.
self
and other
values to be equal, and is used
+by ==
.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.pub struct ParticleVec {
+ pub mass: Vec<f64>,
+ pub position: Vec<[f64; 3]>,
+ pub kind: Vec<usize>,
+ pub name: Vec<String>,
+}
An analog to Vec<Particle>
+
with Struct of Array (SoA) layout
mass: Vec<f64>
a vector of mass
from a
+Particle
position: Vec<[f64; 3]>
a vector of position
from a
+Particle
kind: Vec<usize>
a vector of kind
from a
+Particle
name: Vec<String>
a vector of name
from a
+Particle
Get an iterator over the
+ParticleRef
+in this vector
Get a mutable iterator over the
+ParticleRefMut
+in this vector
Similar to Vec<Particle> ::new()
Similar to Vec<Particle> ::with_capacity()
,
+initializing all fields with the given capacity
.
Similar to Vec<Particle> ::capacity()
,
+the capacity of all fields should be the same.
Similar to Vec<Particle> ::reserve()
,
+reserving the same additional
space for all fields.
Similar to Vec<Particle> ::reserve_exact()
+reserving the same additional
space for all fields.
Similar to Vec<Particle> ::shrink_to_fit()
+shrinking all fields.
Similar to Vec<Particle> ::truncate()
+truncating all fields.
Similar to Vec<Particle> ::push()
.
Similar to Vec<Particle> ::len()
,
+all the fields should have the same length.
Similar to Vec<Particle> ::is_empty()
,
+all the fields should have the same length.
Similar to Vec<Particle> ::swap_remove()
.
Similar to Vec<Particle> ::insert()
.
Similar to std::mem::replace()
.
Similar to Vec<Particle> ::remove()
.
Similar to Vec<Particle> ::pop()
.
Similar to Vec<Particle> ::append()
.
Similar to Vec<Particle> ::clear()
.
Similar to Vec<Particle> ::split_off()
.
Similar to Vec<Particle> ::as_slice()
.
Similar to Vec<Particle> ::as_mut_slice()
.
Create a slice of this vector matching the given range
. This
+is analogous to Index<Range<usize>>
.
Create a mutable slice of this vector matching the given
+range
. This is analogous to IndexMut<Range<usize>>
.
Similar to Vec<Particle> ::retain()
.
Similar to Vec<Particle> ::retain_mut()
.
Similar to Vec<Particle> ::get<I>()
.
Similar to Vec<Particle> ::get_unchecked<I>()
.
Similar to Vec<Particle> ::index<I>()
.
Similar to Vec<Particle> ::get_mut<I>()
.
Similar to Vec<Particle> ::get_unchecked_mut<I>()
.
Similar to Vec<Particle> ::index_mut<I>()
.
Similar to Vec<Particle> ::as_ptr()
.
Similar to Vec<Particle> ::as_mut_ptr()
.
Similar to Vec<Particle> ::from_raw_parts()
.
extend_one
)extend_one
)extend_one
)extend_one
)self
and other
values to be equal, and is used
+by ==
.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
+otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.None
otherwise.1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +
//! This crate is an example for the [`soa_derive`] crate functionalities. All
+//! the code is generated by a single file:
+//!
+//! ```no_run
+//! extern crate soa_derive;
+//! # mod particle {
+//! #[macro_use]
+//! use soa_derive::StructOfArray;
+//!
+//! /// A basic Particle type
+//! #[derive(Debug, PartialEq, StructOfArray)]
+//! #[soa_derive(Debug, PartialEq)]
+//! pub struct Particle {
+//! /// Mass of the particle
+//! pub mass: f64,
+//! /// Position of the particle
+//! pub position: [f64; 3],
+//! /// Kind of the particle
+//! pub kind: usize,
+//! /// Name of the particle
+//! pub name: String,
+//! }
+//! # }
+//! ```
+//!
+//! [`soa_derive`]: https://github.com/lumol-org/soa-derive/
+
+// Deny most of allow by default lints, just to be sure we don't create warning in user code.
+// They are to be selectively allowed in the implementation
+#![deny(absolute_paths_not_starting_with_crate, anonymous_parameters, bare_trait_objects)]
+#![deny(box_pointers, missing_copy_implementations, missing_debug_implementations)]
+#![deny(missing_docs, trivial_casts, trivial_numeric_casts, unreachable_pub)]
+#![deny(unstable_features, unused_extern_crates, unused_import_braces, unused_labels)]
+#![deny(unused_lifetimes, unused_qualifications, unused_results, variant_size_differences)]
+
+// Other allow by default lints that need to stay allowed
+#![allow(unsafe_code, single_use_lifetimes, elided_lifetimes_in_paths)]
+
+#![deny(warnings)]
+
+#[macro_use]
+extern crate soa_derive;
+
+/// A basic Particle type
+#[derive(Debug, PartialEq, StructOfArray)]
+#[soa_derive(Debug, PartialEq)]
+pub struct Particle {
+ /// Mass of the particle
+ pub mass: f64,
+ /// Position of the particle
+ pub position: [f64; 3],
+ /// Kind of the particle
+ pub kind: usize,
+ /// Name of the particle
+ pub name: String,
+}
+
fn:
) to \
+ restrict the search to a given item kind.","Accepted kinds are: fn
, mod
, struct
, \
+ enum
, trait
, type
, macro
, \
+ and const
.","Search functions by type signature (e.g., vec -> usize
or \
+ -> vec
or String, enum:Cow -> bool
)","You can look for items with an exact name by putting double quotes around \
+ your request: \"string\"
","Look for functions that accept or return \
+ slices and \
+ arrays by writing \
+ square brackets (e.g., -> [u8]
or [] -> Option
)","Look for items inside another one by searching for a path: vec::Vec
",].map(x=>""+x+"
").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="${value.replaceAll(" ", " ")}
`}else{error[index]=value}});output+=`"+""+(item.is_alias===true?(""+item.alias+" - see "):"")+item.displayPath+""+name+" | "+""+""+escape(item.desc)+" |
"+code.outerHTML+" |
fn:
) to \
+ restrict the search to a given type.","Accepted types are: fn
, mod
, struct
, \
+ enum
, trait
, type
, macro
, \
+ and const
.","Search functions by type signature (e.g., vec -> usize
or \
+ * -> vec
)","Search multiple things at once by splitting your query with comma (e.g., \
+ str,u8
or String,struct:Vec,test
)","You can look for items with an exact name by putting double quotes around \
+ your request: \"string\"
","Look for items inside another one by searching for a path: vec::Vec
",].map(x=>""+x+"
").join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="This crate is an example for the soa_derive
crate functionalities. All
+the code is generated by a single file:
+#[macro_use] +extern crate soa_derive; + +/// A basic Particle type +#[derive(Debug, PartialEq, StructOfArray)] +#[soa_derive = "Debug, PartialEq"] +pub struct Particle { + /// Mass of the particle + pub mass: f64, + /// Position of the particle + pub position: [f64; 3], + /// Kind of the particle + pub kind: usize, + /// Name of the particle + pub name: String, +}
Particle | A basic Particle type + |
ParticlePtr | An analog of a pointer to
+ |
ParticlePtrMut | An analog of a mutable pointer to
+ |
ParticleRef | A reference to a
+ |
ParticleRefMut | A mutable reference to a
+ |
ParticleSlice | A slice of
+ |
ParticleSliceMut | A mutable slice of
+ |
ParticleVec | An analog to |
A basic Particle type
+mass: f64
Mass of the particle
+position: [f64; 3]
Position of the particle
+kind: usize
Kind of the particle
+name: String
Name of the particle
+impl Particle
[src]pub fn as_ref(&self) -> ParticleRef<'_>
[src]Create a
+ParticleRef
+from a borrowed
+Particle
+.
pub fn as_mut(&mut self) -> ParticleRefMut<'_>
[src]Create a
+ParticleRefMut
+from a mutably borrowed
+Particle
+.
impl Debug for Particle
[src]impl FromIterator<Particle> for ParticleVec
[src]fn from_iter<T: IntoIterator<Item = Particle>>(iter: T) -> Self
[src]impl PartialEq<Particle> for Particle
[src]impl StructOfArray for Particle
[src]type Type = ParticleVec
impl StructuralPartialEq for Particle
[src]impl RefUnwindSafe for Particle
impl Send for Particle
impl Sync for Particle
impl Unpin for Particle
impl UnwindSafe for Particle
impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]fn borrow_mut(&mut self) -> &mut T
[src]impl<T> From<T> for T
[src]impl<T, U> Into<U> for T where
U: From<T>,
[src]impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]type Error = Infallible
The type returned in the event of a conversion error.
+fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]An analog of a pointer to
+Particle
+with struct of array layout.
mass: *const f64
A pointer to a mass
from a ParticleVec
position: *const [f64; 3]
A pointer to a position
from a ParticleVec
kind: *const usize
A pointer to a kind
from a ParticleVec
name: *const String
A pointer to a name
from a ParticleVec
impl ParticlePtr
[src]pub fn as_mut_ptr(&self) -> ParticlePtrMut
[src]Convert a
+ParticlePtr
+to a
+ParticlePtrMut
+; i.e. do a *const T as *mut T
transformation.
pub fn is_null(self) -> bool
[src]Similar to *const T::is_null()
.
pub unsafe fn as_ref<'a>(self) -> Option<ParticleRef<'a>>
[src]Similar to *const T::as_ref()
,
+with the same safety caveats.
pub unsafe fn offset(self, count: isize) -> ParticlePtr
[src]Similar to *const T::offset()
,
+with the same safety caveats.
pub fn wrapping_offset(self, count: isize) -> ParticlePtr
[src]Similar to *const T::offset()
.
pub unsafe fn add(self, count: usize) -> ParticlePtr
[src]Similar to *const T::add()
,
+with the same safety caveats.
pub unsafe fn sub(self, count: usize) -> ParticlePtr
[src]Similar to *const T::sub()
,
+with the same safety caveats.
pub fn wrapping_add(self, count: usize) -> ParticlePtr
[src]Similar to *const T::wrapping_add()
.
pub fn wrapping_sub(self, count: usize) -> ParticlePtr
[src]Similar to *const T::wrapping_sub()
.
pub unsafe fn read(self) -> Particle
[src]Similar to *const T::read()
,
+with the same safety caveats.
pub unsafe fn read_volatile(self) -> Particle
[src]Similar to *const T::read_volatile()
,
+with the same safety caveats.
pub unsafe fn read_unaligned(self) -> Particle
[src]Similar to *const T::read_unaligned()
,
+with the same safety caveats.
impl Clone for ParticlePtr
[src]fn clone(&self) -> ParticlePtr
[src]fn clone_from(&mut self, source: &Self)
1.0.0[src]impl Copy for ParticlePtr
[src]impl Debug for ParticlePtr
[src]impl PartialEq<ParticlePtr> for ParticlePtr
[src]fn eq(&self, other: &ParticlePtr) -> bool
[src]fn ne(&self, other: &ParticlePtr) -> bool
[src]impl StructuralPartialEq for ParticlePtr
[src]impl RefUnwindSafe for ParticlePtr
impl !Send for ParticlePtr
impl !Sync for ParticlePtr
impl Unpin for ParticlePtr
impl UnwindSafe for ParticlePtr
impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]fn borrow_mut(&mut self) -> &mut T
[src]impl<T> From<T> for T
[src]impl<T, U> Into<U> for T where
U: From<T>,
[src]impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
The resulting type after obtaining ownership.
+fn to_owned(&self) -> T
[src]fn clone_into(&self, target: &mut T)
[src]impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]type Error = Infallible
The type returned in the event of a conversion error.
+fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]An analog of a mutable pointer to
+Particle
+with struct of array layout.
mass: *mut f64
A mutable pointer to a mass
from a ParticleVec
position: *mut [f64; 3]
A mutable pointer to a position
from a ParticleVec
kind: *mut usize
A mutable pointer to a kind
from a ParticleVec
name: *mut String
A mutable pointer to a name
from a ParticleVec
impl ParticlePtrMut
[src]pub fn as_ptr(&self) -> ParticlePtr
[src]Convert a
+ParticlePtrMut
+to a
+ParticlePtr
+; i.e. do a *mut T as *const T
transformation
pub fn is_null(self) -> bool
[src]Similar to *mut T::is_null()
.
pub unsafe fn as_ref<'a>(self) -> Option<ParticleRef<'a>>
[src]Similar to *mut T::as_ref()
,
+with the same safety caveats.
pub unsafe fn as_mut<'a>(self) -> Option<ParticleRefMut<'a>>
[src]Similar to *mut T::as_mut()
,
+with the same safety caveats.
pub unsafe fn offset(self, count: isize) -> ParticlePtrMut
[src]Similar to *mut T::offset()
,
+with the same safety caveats.
pub fn wrapping_offset(self, count: isize) -> ParticlePtrMut
[src]Similar to *mut T::wrapping_offset()
pub unsafe fn add(self, count: usize) -> ParticlePtrMut
[src]Similar to *mut T::add()
,
+with the same safety caveats.
pub unsafe fn sub(self, count: usize) -> ParticlePtrMut
[src]Similar to *mut T::sub()
,
+with the same safety caveats.
pub fn wrapping_add(self, count: usize) -> ParticlePtrMut
[src]Similar to *mut T::wrapping_add()
,
+with the same safety caveats.
pub fn wrapping_sub(self, count: usize) -> ParticlePtrMut
[src]Similar to *mut T::wrapping_sub()
,
+with the same safety caveats.
pub unsafe fn read(self) -> Particle
[src]Similar to *mut T::read()
,
+with the same safety caveats.
pub unsafe fn read_volatile(self) -> Particle
[src]Similar to *mut T::read_volatile()
,
+with the same safety caveats.
pub unsafe fn read_unaligned(self) -> Particle
[src]Similar to *mut T::read_unaligned()
,
+with the same safety caveats.
pub unsafe fn write(self, val: Particle)
[src]Similar to *mut T::write()
,
+with the same safety caveats.
pub unsafe fn write_volatile(self, val: Particle)
[src]Similar to *mut T::write_volatile()
,
+with the same safety caveats.
pub unsafe fn write_unaligned(self, val: Particle)
[src]Similar to *mut T::write_unaligned()
,
+with the same safety caveats.
impl Clone for ParticlePtrMut
[src]fn clone(&self) -> ParticlePtrMut
[src]fn clone_from(&mut self, source: &Self)
1.0.0[src]impl Copy for ParticlePtrMut
[src]impl Debug for ParticlePtrMut
[src]impl PartialEq<ParticlePtrMut> for ParticlePtrMut
[src]fn eq(&self, other: &ParticlePtrMut) -> bool
[src]fn ne(&self, other: &ParticlePtrMut) -> bool
[src]impl StructuralPartialEq for ParticlePtrMut
[src]impl RefUnwindSafe for ParticlePtrMut
impl !Send for ParticlePtrMut
impl !Sync for ParticlePtrMut
impl Unpin for ParticlePtrMut
impl UnwindSafe for ParticlePtrMut
impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]fn borrow_mut(&mut self) -> &mut T
[src]impl<T> From<T> for T
[src]impl<T, U> Into<U> for T where
U: From<T>,
[src]impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
The resulting type after obtaining ownership.
+fn to_owned(&self) -> T
[src]fn clone_into(&self, target: &mut T)
[src]impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]type Error = Infallible
The type returned in the event of a conversion error.
+fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]A reference to a
+Particle
+with struct of array layout.
mass: &'a f64
A reference to a mass
from a ParticleVec
position: &'a [f64; 3]
A reference to a position
from a ParticleVec
kind: &'a usize
A reference to a kind
from a ParticleVec
name: &'a String
A reference to a name
from a ParticleVec
impl<'a> ParticleRef<'a>
[src]pub fn as_ptr(&self) -> ParticlePtr
[src]Convert a
+ParticleRef
+to a
+ParticlePtr
+; i.e. do a &T as *const T
transformation
impl<'a> Clone for ParticleRef<'a>
[src]fn clone(&self) -> ParticleRef<'a>
[src]fn clone_from(&mut self, source: &Self)
1.0.0[src]impl<'a> Copy for ParticleRef<'a>
[src]impl<'a> Debug for ParticleRef<'a>
[src]impl<'a> PartialEq<ParticleRef<'a>> for ParticleRef<'a>
[src]fn eq(&self, other: &ParticleRef<'a>) -> bool
[src]fn ne(&self, other: &ParticleRef<'a>) -> bool
[src]impl<'a> StructuralPartialEq for ParticleRef<'a>
[src]impl<'a> RefUnwindSafe for ParticleRef<'a>
impl<'a> Send for ParticleRef<'a>
impl<'a> Sync for ParticleRef<'a>
impl<'a> Unpin for ParticleRef<'a>
impl<'a> UnwindSafe for ParticleRef<'a>
impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]fn borrow_mut(&mut self) -> &mut T
[src]impl<T> From<T> for T
[src]impl<T, U> Into<U> for T where
U: From<T>,
[src]impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
The resulting type after obtaining ownership.
+fn to_owned(&self) -> T
[src]fn clone_into(&self, target: &mut T)
[src]impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]type Error = Infallible
The type returned in the event of a conversion error.
+fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]A mutable reference to a
+Particle
+with struct of array layout.
mass: &'a mut f64
A mutable reference to a mass
from a ParticleVec
position: &'a mut [f64; 3]
A mutable reference to a position
from a ParticleVec
kind: &'a mut usize
A mutable reference to a kind
from a ParticleVec
name: &'a mut String
A mutable reference to a name
from a ParticleVec
impl<'a> ParticleRefMut<'a>
[src]pub fn as_ptr(&self) -> ParticlePtr
[src]Convert a
+ParticleRefMut
+to a
+ParticlePtr
+; i.e. do a &mut T as *const T
transformation
pub fn as_mut_ptr(&mut self) -> ParticlePtrMut
[src]Convert a
+ParticleRefMut
+to a
+ParticlePtrMut
+; i.e. do a &mut T as *mut T
transformation
impl<'a> Debug for ParticleRefMut<'a>
[src]impl<'a> PartialEq<ParticleRefMut<'a>> for ParticleRefMut<'a>
[src]fn eq(&self, other: &ParticleRefMut<'a>) -> bool
[src]fn ne(&self, other: &ParticleRefMut<'a>) -> bool
[src]impl<'a> StructuralPartialEq for ParticleRefMut<'a>
[src]impl<'a> RefUnwindSafe for ParticleRefMut<'a>
impl<'a> Send for ParticleRefMut<'a>
impl<'a> Sync for ParticleRefMut<'a>
impl<'a> Unpin for ParticleRefMut<'a>
impl<'a> !UnwindSafe for ParticleRefMut<'a>
impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]fn borrow_mut(&mut self) -> &mut T
[src]impl<T> From<T> for T
[src]impl<T, U> Into<U> for T where
U: From<T>,
[src]impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]type Error = Infallible
The type returned in the event of a conversion error.
+fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]A slice of
+Particle
+inside a
+ParticleVec
+.
mass: &'a [f64]
A slice of mass
from a ParticleVec
position: &'a [[f64; 3]]
A slice of position
from a ParticleVec
kind: &'a [usize]
A slice of kind
from a ParticleVec
name: &'a [String]
A slice of name
from a ParticleVec
impl<'a> ParticleSlice<'a>
[src]pub fn iter(&self) -> Iter<'_>
[src]Get an iterator over the
+ParticleRef
+in this slice.
impl<'a> ParticleSlice<'a>
[src]pub fn len(&self) -> usize
[src]Similar to [Particle] ::len()
,
+the length of all fields should be the same.
pub fn is_empty(&self) -> bool
[src]Similar to [Particle] ::is_empty()
,
+the length of all fields should be the same.
pub fn first(&self) -> Option<ParticleRef<'a>>
[src]Similar to [Particle] ::first()
.
pub fn split_first(&self) -> Option<(ParticleRef<'a>, ParticleSlice<'a>)>
[src]Similar to [Particle] ::split_first()
.
pub fn last(&self) -> Option<ParticleRef<'a>>
[src]Similar to [Particle] ::last()
.
pub fn split_last(&self) -> Option<(ParticleRef<'a>, ParticleSlice<'a>)>
[src]Similar to [Particle] ::split_last()
.
pub fn split_at(&self, mid: usize) -> (ParticleSlice<'a>, ParticleSlice<'a>)
[src]Similar to [Particle] ::split_at()
.
pub fn get<'b, I>(&'b self, index: I) -> Option<I::RefOutput> where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b,
[src]Similar to [Particle] ::get()
.
pub unsafe fn get_unchecked<'b, I>(&'b self, index: I) -> I::RefOutput where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b,
[src]Similar to [Particle] ::get_unchecked()
.
pub fn index<'b, I>(&'b self, index: I) -> I::RefOutput where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b,
[src]Similar to std::ops::Index
trait on
+[Particle]
+.
+This is required because we cannot implement std::ops::Index
directly since it requires returning a reference.
pub fn reborrow<'b>(&'b self) -> ParticleSlice<'b> where
'a: 'b,
[src]Reborrows the slices in a narrower lifetime
+pub fn as_ptr(&self) -> ParticlePtr
[src]Similar to [Particle] ::as_ptr()
.
pub unsafe fn from_raw_parts<'b>(
data: ParticlePtr,
len: usize
) -> ParticleSlice<'b>
[src]Similar to std::slice::from_raw_parts()
.
impl<'a> Clone for ParticleSlice<'a>
[src]fn clone(&self) -> ParticleSlice<'a>
[src]fn clone_from(&mut self, source: &Self)
1.0.0[src]impl<'a> Copy for ParticleSlice<'a>
[src]impl<'a> Debug for ParticleSlice<'a>
[src]impl<'a> IntoIterator for ParticleSlice<'a>
[src]type Item = ParticleRef<'a>
The type of the elements being iterated over.
+type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
+fn into_iter(self) -> Self::IntoIter
[src]impl<'a, 'b> IntoIterator for &'a ParticleSlice<'b>
[src]type Item = ParticleRef<'a>
The type of the elements being iterated over.
+type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
+fn into_iter(self) -> Self::IntoIter
[src]impl<'a> PartialEq<ParticleSlice<'a>> for ParticleSlice<'a>
[src]fn eq(&self, other: &ParticleSlice<'a>) -> bool
[src]fn ne(&self, other: &ParticleSlice<'a>) -> bool
[src]impl<'a> SoAIndex<ParticleSlice<'a>> for usize
[src]type RefOutput = ParticleRef<'a>
The output for the non-mutable functions
+fn get(self, slice: ParticleSlice<'a>) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]fn index(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]impl<'a> SoAIndex<ParticleSlice<'a>> for Range<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, slice: ParticleSlice<'a>) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]fn index(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]impl<'a> SoAIndex<ParticleSlice<'a>> for RangeTo<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, slice: ParticleSlice<'a>) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]fn index(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]impl<'a> SoAIndex<ParticleSlice<'a>> for RangeFrom<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, slice: ParticleSlice<'a>) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]fn index(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]impl<'a> SoAIndex<ParticleSlice<'a>> for RangeFull
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, slice: ParticleSlice<'a>) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]fn index(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]impl<'a> SoAIndex<ParticleSlice<'a>> for RangeInclusive<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, slice: ParticleSlice<'a>) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]fn index(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]impl<'a> SoAIndex<ParticleSlice<'a>> for RangeToInclusive<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, slice: ParticleSlice<'a>) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]fn index(self, slice: ParticleSlice<'a>) -> Self::RefOutput
[src]impl<'a> StructuralPartialEq for ParticleSlice<'a>
[src]impl<'a> RefUnwindSafe for ParticleSlice<'a>
impl<'a> Send for ParticleSlice<'a>
impl<'a> Sync for ParticleSlice<'a>
impl<'a> Unpin for ParticleSlice<'a>
impl<'a> UnwindSafe for ParticleSlice<'a>
impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]fn borrow_mut(&mut self) -> &mut T
[src]impl<T> From<T> for T
[src]impl<T, U> Into<U> for T where
U: From<T>,
[src]impl<I> IntoIterator for I where
I: Iterator,
[src]type Item = <I as Iterator>::Item
The type of the elements being iterated over.
+type IntoIter = I
Which kind of iterator are we turning this into?
+fn into_iter(self) -> I
[src]impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
The resulting type after obtaining ownership.
+fn to_owned(&self) -> T
[src]fn clone_into(&self, target: &mut T)
[src]impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]type Error = Infallible
The type returned in the event of a conversion error.
+fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]A mutable slice of
+Particle
+inside a
+ParticleVec
+.
mass: &'a mut [f64]
A mutable slice of mass
from a ParticleVec
position: &'a mut [[f64; 3]]
A mutable slice of position
from a ParticleVec
kind: &'a mut [usize]
A mutable slice of kind
from a ParticleVec
name: &'a mut [String]
A mutable slice of name
from a ParticleVec
impl<'a> ParticleSliceMut<'a>
[src]pub fn iter(&mut self) -> Iter<'_>
[src]Get an iterator over the
+ParticleRef
+in this vector
pub fn iter_mut(&mut self) -> IterMut<'_>
[src]Get a mutable iterator over the
+ParticleRefMut
+in this vector
impl<'a> ParticleSliceMut<'a>
[src]pub fn as_ref(&self) -> ParticleSlice<'_>
[src]Convert a
+ParticleSliceMut
+to a
+ParticleSlice
+in order to be able to use the methods on the non mutable
+version of the slices.
pub fn len(&self) -> usize
[src]Similar to [Particle] ::len()
,
+the length of all fields should be the same.
pub fn is_empty(&self) -> bool
[src]Similar to [Particle] ::is_empty()
,
+the length of all fields should be the same.
pub fn first_mut(&mut self) -> Option<ParticleRefMut<'_>>
[src]Similar to [Particle] ::first_mut()
.
pub fn split_first_mut(
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>
[src]Similar to [Particle] ::split_first_mut()
.
pub fn last_mut(&mut self) -> Option<ParticleRefMut<'_>>
[src]Similar to [Particle] ::last_mut()
.
pub fn split_last_mut(
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>
[src]Similar to [Particle] ::last_mut()
.
pub fn split_at_mut(
&mut self,
mid: usize
) -> (ParticleSliceMut<'_>, ParticleSliceMut<'_>)
[src]Similar to [Particle] ::split_at_mut()
.
pub fn swap(&mut self, a: usize, b: usize)
[src]Similar to [Particle] ::swap()
.
pub fn get<'b, I>(&'b self, index: I) -> Option<I::RefOutput> where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b,
[src]Similar to [Particle] ::get()
.
pub unsafe fn get_unchecked<'b, I>(&'b self, index: I) -> I::RefOutput where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b,
[src]Similar to [Particle] ::get_unchecked()
.
pub fn index<'b, I>(&'b self, index: I) -> I::RefOutput where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b,
[src]Similar to std::ops::Index
trait on
+[Particle]
+.
+This is required because we cannot implement that trait.
pub fn get_mut<'b, I>(&'b mut self, index: I) -> Option<I::MutOutput> where
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: 'b,
[src]Similar to [Particle] ::get_mut()
.
pub unsafe fn get_unchecked_mut<'b, I>(&'b mut self, index: I) -> I::MutOutput where
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: 'b,
[src]Similar to [Particle] ::get_unchecked_mut()
.
pub fn index_mut<'b, I>(&'b mut self, index: I) -> I::MutOutput where
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: 'b,
[src]Similar to std::ops::IndexMut
trait on
+[Particle]
+.
+This is required because we cannot implement std::ops::IndexMut
directly since it requires returning a mutable reference.
pub fn as_slice<'b>(&'b self) -> ParticleSlice<'b> where
'a: 'b,
[src]Returns a non-mutable slice from this mutable slice.
+pub fn reborrow<'b>(&'b mut self) -> ParticleSliceMut<'b> where
'a: 'b,
[src]Reborrows the slices in a narrower lifetime
+pub fn as_ptr(&self) -> ParticlePtr
[src]Similar to [Particle] ::as_ptr()
.
pub fn as_mut_ptr(&mut self) -> ParticlePtrMut
[src]Similar to [Particle] ::as_mut_ptr()
.
pub unsafe fn from_raw_parts_mut<'b>(
data: ParticlePtrMut,
len: usize
) -> ParticleSliceMut<'b>
[src]Similar to std::slice::from_raw_parts_mut()
.
impl<'a> Debug for ParticleSliceMut<'a>
[src]impl<'a> IntoIterator for ParticleSliceMut<'a>
[src]type Item = ParticleRefMut<'a>
The type of the elements being iterated over.
+type IntoIter = IterMut<'a>
Which kind of iterator are we turning this into?
+fn into_iter(self) -> Self::IntoIter
[src]impl<'a> PartialEq<ParticleSliceMut<'a>> for ParticleSliceMut<'a>
[src]fn eq(&self, other: &ParticleSliceMut<'a>) -> bool
[src]fn ne(&self, other: &ParticleSliceMut<'a>) -> bool
[src]impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for usize
[src]type MutOutput = ParticleRefMut<'a>
The output for the mutable functions
+fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
[src]fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for Range<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
[src]fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeTo<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
[src]fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeFrom<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
[src]fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeFull
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
[src]fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeInclusive<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
[src]fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeToInclusive<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
[src]fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput
[src]impl<'a> StructuralPartialEq for ParticleSliceMut<'a>
[src]impl<'a> RefUnwindSafe for ParticleSliceMut<'a>
impl<'a> Send for ParticleSliceMut<'a>
impl<'a> Sync for ParticleSliceMut<'a>
impl<'a> Unpin for ParticleSliceMut<'a>
impl<'a> !UnwindSafe for ParticleSliceMut<'a>
impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]fn borrow_mut(&mut self) -> &mut T
[src]impl<T> From<T> for T
[src]impl<T, U> Into<U> for T where
U: From<T>,
[src]impl<I> IntoIterator for I where
I: Iterator,
[src]type Item = <I as Iterator>::Item
The type of the elements being iterated over.
+type IntoIter = I
Which kind of iterator are we turning this into?
+fn into_iter(self) -> I
[src]impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]type Error = Infallible
The type returned in the event of a conversion error.
+fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]An analog to Vec<Particle>
+
with Struct of Array (SoA) layout
mass: Vec<f64>
A vector of mass
from a Particle
position: Vec<[f64; 3]>
A vector of position
from a Particle
kind: Vec<usize>
A vector of kind
from a Particle
name: Vec<String>
A vector of name
from a Particle
impl ParticleVec
[src]pub fn iter(&self) -> Iter<'_>
[src]Get an iterator over the
+ParticleRef
+in this vector
impl ParticleVec
[src]pub fn iter_mut(&mut self) -> IterMut<'_>
[src]Get a mutable iterator over the
+ParticleRefMut
+in this vector
impl ParticleVec
[src]pub fn new() -> ParticleVec
[src]Similar to Vec<Particle> ::new()
pub fn with_capacity(capacity: usize) -> ParticleVec
[src]Similar to Vec<Particle> ::with_capacity()
,
+initializing all fields with the given capacity
.
pub fn capacity(&self) -> usize
[src]Similar to Vec<Particle> ::capacity()
,
+the capacity of all fields should be the same.
pub fn reserve(&mut self, additional: usize)
[src]Similar to Vec<Particle> ::reserve()
,
+reserving the same additional
space for all fields.
pub fn reserve_exact(&mut self, additional: usize)
[src]Similar to Vec<Particle> ::reserve_exact()
+reserving the same additional
space for all fields.
pub fn shrink_to_fit(&mut self)
[src]Similar to Vec<Particle> ::shrink_to_fit()
+shrinking all fields.
pub fn truncate(&mut self, len: usize)
[src]Similar to Vec<Particle> ::truncate()
+truncating all fields.
pub fn push(&mut self, value: Particle)
[src]Similar to Vec<Particle> ::push()
.
pub fn len(&self) -> usize
[src]Similar to Vec<Particle> ::len()
,
+all the fields should have the same length.
pub fn is_empty(&self) -> bool
[src]Similar to Vec<Particle> ::is_empty()
,
+all the fields should have the same length.
pub fn swap_remove(&mut self, index: usize) -> Particle
[src]Similar to Vec<Particle> ::swap_remove()
.
pub fn insert(&mut self, index: usize, element: Particle)
[src]Similar to Vec<Particle> ::insert()
.
pub fn remove(&mut self, index: usize) -> Particle
[src]Similar to Vec<Particle> ::remove()
.
pub fn pop(&mut self) -> Option<Particle>
[src]Similar to Vec<Particle> ::pop()
.
pub fn append(&mut self, other: &mut ParticleVec)
[src]Similar to Vec<Particle> ::append()
.
pub fn clear(&mut self)
[src]Similar to Vec<Particle> ::clear()
.
pub fn split_off(&mut self, at: usize) -> ParticleVec
[src]Similar to Vec<Particle> ::split_off()
.
pub fn as_slice(&self) -> ParticleSlice<'_>
[src]Similar to Vec<Particle> ::as_slice()
.
pub fn as_mut_slice(&mut self) -> ParticleSliceMut<'_>
[src]Similar to Vec<Particle> ::as_mut_slice()
.
pub fn slice(&self, range: Range<usize>) -> ParticleSlice<'_>
[src]Create a slice of this vector matching the given range
. This
+is analogous to Index<Range<usize>>
.
pub fn slice_mut(&mut self, range: Range<usize>) -> ParticleSliceMut<'_>
[src]Create a mutable slice of this vector matching the given
+range
. This is analogous to IndexMut<Range<usize>>
.
pub fn retain<F>(&mut self, f: F) where
F: FnMut(ParticleRef<'_>) -> bool,
[src]Similar to Vec<Particle> ::retain()
.
pub fn get<'a, I>(&'a self, index: I) -> Option<I::RefOutput> where
I: SoAIndex<&'a ParticleVec>,
[src]Similar to Vec<Particle> ::get<I>()
.
pub unsafe fn get_unchecked<'a, I>(&'a self, index: I) -> I::RefOutput where
I: SoAIndex<&'a ParticleVec>,
[src]Similar to Vec<Particle> ::get_unchecked<I>()
.
pub fn index<'a, I>(&'a self, index: I) -> I::RefOutput where
I: SoAIndex<&'a ParticleVec>,
[src]Similar to Vec<Particle> ::index<I>()
.
pub fn get_mut<'a, I>(&'a mut self, index: I) -> Option<I::MutOutput> where
I: SoAIndexMut<&'a mut ParticleVec>,
[src]Similar to Vec<Particle> ::get_mut<I>()
.
pub unsafe fn get_unchecked_mut<'a, I>(&'a mut self, index: I) -> I::MutOutput where
I: SoAIndexMut<&'a mut ParticleVec>,
[src]Similar to Vec<Particle> ::get_unchecked_mut<I>()
.
pub fn index_mut<'a, I>(&'a mut self, index: I) -> I::MutOutput where
I: SoAIndexMut<&'a mut ParticleVec>,
[src]Similar to Vec<Particle> ::index_mut<I>()
.
pub fn as_ptr(&self) -> ParticlePtr
[src]Similar to Vec<Particle> ::as_ptr()
.
pub fn as_mut_ptr(&mut self) -> ParticlePtrMut
[src]Similar to Vec<Particle> ::as_mut_ptr()
.
pub unsafe fn from_raw_parts(
data: ParticlePtrMut,
len: usize,
capacity: usize
) -> ParticleVec
[src]Similar to Vec<Particle> ::from_raw_parts()
.
impl Debug for ParticleVec
[src]impl FromIterator<Particle> for ParticleVec
[src]fn from_iter<T: IntoIterator<Item = Particle>>(iter: T) -> Self
[src]impl<'a> IntoIterator for &'a ParticleVec
[src]type Item = ParticleRef<'a>
The type of the elements being iterated over.
+type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
+fn into_iter(self) -> Self::IntoIter
[src]impl<'a> IntoIterator for &'a mut ParticleVec
[src]type Item = ParticleRefMut<'a>
The type of the elements being iterated over.
+type IntoIter = IterMut<'a>
Which kind of iterator are we turning this into?
+fn into_iter(self) -> Self::IntoIter
[src]impl PartialEq<ParticleVec> for ParticleVec
[src]fn eq(&self, other: &ParticleVec) -> bool
[src]fn ne(&self, other: &ParticleVec) -> bool
[src]impl<'a> SoAIndex<&'a ParticleVec> for usize
[src]type RefOutput = ParticleRef<'a>
The output for the non-mutable functions
+fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]impl<'a> SoAIndex<&'a ParticleVec> for Range<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]impl<'a> SoAIndex<&'a ParticleVec> for RangeTo<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]impl<'a> SoAIndex<&'a ParticleVec> for RangeFrom<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]impl<'a> SoAIndex<&'a ParticleVec> for RangeFull
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]impl<'a> SoAIndex<&'a ParticleVec> for RangeInclusive<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]impl<'a> SoAIndex<&'a ParticleVec> for RangeToInclusive<usize>
[src]type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
+fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]impl<'a> SoAIndexMut<&'a mut ParticleVec> for usize
[src]type MutOutput = ParticleRefMut<'a>
The output for the mutable functions
+fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<&'a mut ParticleVec> for Range<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeTo<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeFrom<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeFull
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeInclusive<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeToInclusive<usize>
[src]type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
+fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]impl StructuralPartialEq for ParticleVec
[src]impl RefUnwindSafe for ParticleVec
impl Send for ParticleVec
impl Sync for ParticleVec
impl Unpin for ParticleVec
impl UnwindSafe for ParticleVec
impl<T> Any for T where
T: 'static + ?Sized,
[src]impl<T> Borrow<T> for T where
T: ?Sized,
[src]impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]fn borrow_mut(&mut self) -> &mut T
[src]impl<T> From<T> for T
[src]impl<T, U> Into<U> for T where
U: From<T>,
[src]impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]type Error = Infallible
The type returned in the event of a conversion error.
+fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +
+//! This crate is an example for the [`soa_derive`] crate functionalities. All +//! the code is generated by a single file: +//! +//! ```no_run +//! #[macro_use] +//! extern crate soa_derive; +//! # fn main() { +//! +//! /// A basic Particle type +//! #[derive(Debug, PartialEq, StructOfArray)] +//! #[soa_derive = "Debug, PartialEq"] +//! pub struct Particle { +//! /// Mass of the particle +//! pub mass: f64, +//! /// Position of the particle +//! pub position: [f64; 3], +//! /// Kind of the particle +//! pub kind: usize, +//! /// Name of the particle +//! pub name: String, +//! } +//! # } +//! ``` +//! +//! [`soa_derive`]: https://github.com/lumol-org/soa-derive/ + +// Deny most of allow by default lints, just to be sure we don't create warning in user code. +// They are to be selectively allowed in the implementation +#![deny(absolute_paths_not_starting_with_crate, anonymous_parameters, bare_trait_objects)] +#![deny(box_pointers, missing_copy_implementations, missing_debug_implementations)] +#![deny(missing_docs, trivial_casts, trivial_numeric_casts, unreachable_pub)] +#![deny(unstable_features, unused_extern_crates, unused_import_braces, unused_labels)] +#![deny(unused_lifetimes, unused_qualifications, unused_results, variant_size_differences)] + +// Other allow by default lints that need to stay allowed +#![allow(unsafe_code, single_use_lifetimes, elided_lifetimes_in_paths)] + +#![deny(warnings)] + +#[macro_use] +extern crate soa_derive; + +/// A basic Particle type +#[derive(Debug, PartialEq, StructOfArray)] +#[soa_derive = "Debug, PartialEq"] +pub struct Particle { + /// Mass of the particle + pub mass: f64, + /// Position of the particle + pub position: [f64; 3], + /// Kind of the particle + pub kind: usize, + /// Name of the particle + pub name: String, +} +