orx_pinned_vec/into_concurrent_pinned_vec.rs
1use crate::{ConcurrentPinnedVec, PinnedVec};
2
3/// A pinned vector which can be wrapped into a concurrent pinned vector.
4pub trait IntoConcurrentPinnedVec<T>: PinnedVec<T> {
5 /// Type of the concurrent pinned vector wrapper.
6 type ConPinnedVec: ConcurrentPinnedVec<T, P = Self>;
7
8 /// Converts the pinned vector into its concurrent wrapper.
9 fn into_concurrent(self) -> Self::ConPinnedVec;
10
11 /// Converts the pinned vector into its concurrent wrapper.
12 /// During conversion:
13 ///
14 /// * length of the vector is increased to its capacity;
15 /// * the elements in the range `len..capacity` are filled with the values
16 /// obtained by repeatedly calling the function `fill_with`.
17 fn into_concurrent_filled_with<F>(self, fill_with: F) -> Self::ConPinnedVec
18 where
19 F: Fn() -> T;
20}