Trait parallel_vec::param::ParallelVecParam
source · [−]pub unsafe trait ParallelVecParam: Sized + Sealed {
type Storage: Copy;
type Ptr: Copy;
type Offsets;
type Ref;
type RefMut;
type Vecs;
type Slices;
type SlicesMut;
type Iters;
type ItersMut;
Show 21 methods
fn dangling() -> Self::Storage;
fn as_ptr(storage: Self::Storage) -> Self::Ptr;
unsafe fn alloc(capacity: usize) -> Self::Storage;
unsafe fn dealloc(storage: &mut Self::Storage, capacity: usize);
fn layout_for_capacity(capacity: usize) -> MemoryLayout<Self>;
fn get_vec_len(vecs: &Self::Vecs) -> Option<usize>;
unsafe fn get_vec_ptrs(vecs: &mut Self::Vecs) -> Self::Ptr;
unsafe fn add(base: Self::Ptr, offset: usize) -> Self::Ptr;
unsafe fn copy_to(src: Self::Ptr, dst: Self::Ptr, size: usize);
unsafe fn copy_to_nonoverlapping(
src: Self::Ptr,
dst: Self::Ptr,
size: usize
);
unsafe fn as_slices<'a>(ptr: Self::Ptr, len: usize) -> Self::Slices;
unsafe fn as_slices_mut<'a>(ptr: Self::Ptr, len: usize) -> Self::SlicesMut;
fn iters<'a>(slices: Self::Slices) -> Self::Iters;
fn iters_mut<'a>(slices: Self::SlicesMut) -> Self::ItersMut;
fn reverse(ptr: Self::SlicesMut);
unsafe fn as_ref<'a>(ptr: Self::Ptr) -> Self::Ref;
unsafe fn as_mut<'a>(ptr: Self::Ptr) -> Self::RefMut;
unsafe fn read(ptr: Self::Ptr) -> Self;
unsafe fn write(ptr: Self::Ptr, value: Self);
unsafe fn swap(a: Self::Ptr, other: Self::Ptr);
unsafe fn drop(ptr: Self::Ptr);
}Expand description
This trait contains the basic operations for creating variadic parallel vector implementations.
This trait is sealed and cannot be implemented outside of
parallel_vec.
This trait has blanket implementations of all tuples of up
to size 12 of all types that are 'static.
Safety
None of the associated functions can panic.
Associated Types
A set of NonNull pointers of the parameter.
This is the main backing storage pointers for ParallelVec.
Required methods
Converts a set of NonNulls into their associated
pointer types.
fn layout_for_capacity(capacity: usize) -> MemoryLayout<Self>
fn layout_for_capacity(capacity: usize) -> MemoryLayout<Self>
Creates a layout for a ParallelVec for a given capacity
fn get_vec_len(vecs: &Self::Vecs) -> Option<usize>
fn get_vec_len(vecs: &Self::Vecs) -> Option<usize>
Gets the legnth for the associated Vecs.
Returns None if not all of the Vecs share the same
length.
unsafe fn get_vec_ptrs(vecs: &mut Self::Vecs) -> Self::Ptr
unsafe fn get_vec_ptrs(vecs: &mut Self::Vecs) -> Self::Ptr
Gets the underlying pointers for the associated Vecs.
Safety
The provided Vecs must be correctly allocated.
Adds offset to all of the pointers in base.
Safety
base and base + offset must be valid non-null pointers for
the associated types.
Copies size elements from the continguous memory pointed to by src into
dst.
Safety
srcanddstmust be a valid, non-null pointer for the associated types.sizemust be approriately set for the allocation that bothsrcanddstpoint to.
unsafe fn copy_to_nonoverlapping(src: Self::Ptr, dst: Self::Ptr, size: usize)
unsafe fn copy_to_nonoverlapping(src: Self::Ptr, dst: Self::Ptr, size: usize)
Copies size elements from the continguous memory pointed to by src into
dst.
Safety
srcanddstmust be a valid, non-null pointer for the associated types.sizemust be approriately set for the allocation that bothsrcanddstpoint to.src..src + sizemust not overlap with the memory range ofdst..dst + size.
Creates a set of immutable slices from ptr and a provided length.
Safety
ptr must be a valid, non-null pointer. len must be approriately set
for the allocation that ptr points to.
unsafe fn as_slices_mut<'a>(ptr: Self::Ptr, len: usize) -> Self::SlicesMut
unsafe fn as_slices_mut<'a>(ptr: Self::Ptr, len: usize) -> Self::SlicesMut
Creates a set of mutable slices from ptr and a provided length.
Safety
ptr must be a valid, non-null pointer. len must be approriately set
for the allocation that ptr points to.
Creates a set of iterators of mutable references from slices.
Swaps the values pointed to by the provided pointers.
Safety
Both a and b must be valid for all of it’s consitutent member pointers.