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.

A set of pointers of the parameter.

A set of memory offsets of the parameter.

A set of immutable references of the parameter.

A set of mutable references of the parameter.

A set of Vec<T>s of the parameter.

A set of mutable slice references of the parameter.

A set of mutable slice references of the parameter.

A set of iterators of immutable references of the parameter.

A set of iterators of mutable references of the parameter.

Required methods

Creates a set of dangling pointers for the given types.

Converts a set of NonNulls into their associated pointer types.

Allocates a buffer for a given capacity.

Safety

Capacity should be non-zero.

Deallocates a buffer allocated from alloc.

Safety

storage must have been allocated from alloc alongside the provided capacity.

Creates a layout for a ParallelVec for a given capacity

Gets the legnth for the associated Vecs.

Returns None if not all of the Vecs share the same length.

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
  • src and dst must be a valid, non-null pointer for the associated types.
  • size must be approriately set for the allocation that both src and dst point to.

Copies size elements from the continguous memory pointed to by src into dst.

Safety
  • src and dst must be a valid, non-null pointer for the associated types.
  • size must be approriately set for the allocation that both src and dst point to.
  • src..src + size must not overlap with the memory range of dst..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.

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 from slices.

Creates a set of iterators of mutable references from slices.

Reverses the order of elements in the slice, in place.

Converts ptr into a set of immutable references.

Safety

ptr must be a valid, non-null pointer.

Converts ptr into a set of mutable references.

Safety

ptr must be a valid, non-null pointer.

Reads the values to pointed to by ptr.

Safety

ptr must be a valid, non-null pointer.

Writes value to ptr.

Safety

ptr must be a valid, non-null pointer.

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.

Drops the values pointed to by the pointers.

Safety

The caller must ensure that the values pointed to by the pointers have not already been dropped prior.

Implementations on Foreign Types

Implementors