Struct orx_split_vec::ConcurrentSplitVec

source ·
pub struct ConcurrentSplitVec<T, G: GrowthWithConstantTimeAccess = Doubling> { /* private fields */ }
Expand description

Concurrent wrapper (orx_pinned_vec::ConcurrentPinnedVec) for the SplitVec.

Trait Implementations§

source§

impl<T, G: GrowthWithConstantTimeAccess> ConcurrentPinnedVec<T> for ConcurrentSplitVec<T, G>

source§

type P = SplitVec<T, G>

Type of the wrapped pinned vector.
source§

unsafe fn into_inner(self, len: usize) -> Self::P

Converts back to the underlying pinned vector with the given length. Read more
source§

unsafe fn clone_with_len(&self, len: usize) -> Self
where T: Clone,

Clones the concurrent pinned vector with for the first len elements. The created concurrent vector will have the same capacity and maximum capacity as this collection; however, only the values within 0..len will be cloned to the target. Read more
source§

fn slices<R: RangeBounds<usize>>( &self, range: R, ) -> <Self::P as PinnedVec<T>>::SliceIter<'_>

Returns an iterator of slices to the elements extending over positions range of the vector.
source§

unsafe fn iter<'a>(&'a self, len: usize) -> impl Iterator<Item = &'a T> + 'a
where T: 'a,

Returns an iterator over positions 0..len of the vector. Read more
source§

unsafe fn iter_over_range<'a, R: RangeBounds<usize>>( &'a self, range: R, ) -> impl Iterator<Item = &'a T> + 'a
where T: 'a,

Returns an iterator over positions range of the vector. Read more
source§

unsafe fn slices_mut<R: RangeBounds<usize>>( &self, range: R, ) -> <Self::P as PinnedVec<T>>::SliceMutIter<'_>

Returns an iterator of mutable slices to the elements extending over positions range of the vector. Read more
source§

unsafe fn iter_mut<'a>( &'a mut self, len: usize, ) -> impl Iterator<Item = &'a mut T> + 'a
where T: 'a,

Returns a mutable iterator over positions 0..len of the vector. Read more
source§

unsafe fn get(&self, index: usize) -> Option<&T>

Returns a reference to the element at the index-th position. Read more
source§

unsafe fn get_mut(&mut self, index: usize) -> Option<&mut T>

Returns a reference to the element at the index-th position. Read more
source§

unsafe fn get_ptr_mut(&self, index: usize) -> *mut T

Returns a mutable reference to the element at the index-th position. Read more
source§

fn max_capacity(&self) -> usize

Returns the maximum possible capacity that the vector can concurrently grow to without requiring a &mut self reference. Read more
source§

fn capacity(&self) -> usize

Returns the current capacity of the vector, which is actually allocated.
source§

fn grow_to(&self, new_capacity: usize) -> Result<usize, PinnedVecGrowthError>

Tries to concurrently grow the capacity of the vector to at least new_capacity. Returns: Read more
source§

fn grow_to_and_fill_with<F>( &self, new_capacity: usize, fill_with: F, ) -> Result<usize, PinnedVecGrowthError>
where F: Fn() -> T,

Tries to concurrently grow the capacity of the vector to at least new_capacity. Returns: Read more
source§

fn fill_with<F>(&self, range: Range<usize>, fill_with: F)
where F: Fn() -> T,

Fills the provided range with elements created by successively calling the fill_with function.
source§

unsafe fn reserve_maximum_concurrent_capacity( &mut self, _current_len: usize, new_maximum_capacity: usize, ) -> usize

Increases the maximum_capacity to the new_maximum_capacity. Read more
source§

unsafe fn reserve_maximum_concurrent_capacity_fill_with<F>( &mut self, current_len: usize, new_maximum_capacity: usize, _fill_with: F, ) -> usize
where F: Fn() -> T,

Increases the maximum_capacity to the new_maximum_capacity. If capacity extension leads to allocation, allocated memory is filled with the given function. Read more
source§

unsafe fn set_pinned_vec_len(&mut self, len: usize)

Sets the length of the underlying pinned vector to the given len. Read more
source§

unsafe fn clear(&mut self, len: usize)

Clears the concurrent pinned vector. Read more
source§

impl<T, G: GrowthWithConstantTimeAccess> Drop for ConcurrentSplitVec<T, G>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T, G: GrowthWithConstantTimeAccess> From<SplitVec<T, G>> for ConcurrentSplitVec<T, G>

source§

fn from(value: SplitVec<T, G>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T, G = Doubling> !Freeze for ConcurrentSplitVec<T, G>

§

impl<T, G = Doubling> !RefUnwindSafe for ConcurrentSplitVec<T, G>

§

impl<T, G = Doubling> !Send for ConcurrentSplitVec<T, G>

§

impl<T, G = Doubling> !Sync for ConcurrentSplitVec<T, G>

§

impl<T, G> Unpin for ConcurrentSplitVec<T, G>
where G: Unpin,

§

impl<T, G> UnwindSafe for ConcurrentSplitVec<T, G>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.