pub struct ReusableIndexScratch<K, S = RandomState> { /* private fields */ }Expand description
Reusable duplicate-detection plus stable-order scratch for planner hot paths.
Implementations§
Source§impl<K, S> ReusableIndexScratch<K, S>
impl<K, S> ReusableIndexScratch<K, S>
Sourcepub fn try_reserve_with<E>(
&mut self,
policy: ReservationPolicy,
capacity: usize,
seen_item: &'static str,
ordered_indices_item: &'static str,
failure: StagingReservationFailureAdapter<E>,
) -> Result<(), E>
pub fn try_reserve_with<E>( &mut self, policy: ReservationPolicy, capacity: usize, seen_item: &'static str, ordered_indices_item: &'static str, failure: StagingReservationFailureAdapter<E>, ) -> Result<(), E>
Reserve duplicate-detection and ordering scratch to the requested capacity.
§Errors
Returns E when either retained scratch collection cannot reserve memory.
Sourcepub fn insert_seen(&mut self, key: K) -> bool
pub fn insert_seen(&mut self, key: K) -> bool
Insert a duplicate-detection key.
Sourcepub fn push_index(&mut self, index: usize)
pub fn push_index(&mut self, index: usize)
Append an input index to the reusable ordering buffer.
Sourcepub fn ordered_indices_mut(&mut self) -> &mut Vec<usize>
pub fn ordered_indices_mut(&mut self) -> &mut Vec<usize>
Mutable ordering buffer for planner-specific sort keys.
Sourcepub fn sort_indices_unstable_by_key_if_needed<Key, F>(&mut self, key: F)
pub fn sort_indices_unstable_by_key_if_needed<Key, F>(&mut self, key: F)
Sort ordered indices only when the current key order is not already monotonic.
Sourcepub fn ordered_indices(&self) -> &[usize]
pub fn ordered_indices(&self) -> &[usize]
Ordered input indices after planner-specific sorting.
Sourcepub fn seen_capacity(&self) -> usize
pub fn seen_capacity(&self) -> usize
Retained duplicate-detection capacity.
Sourcepub fn ordered_index_capacity(&self) -> usize
pub fn ordered_index_capacity(&self) -> usize
Retained ordering capacity.
Trait Implementations§
Source§impl<K, S> Debug for ReusableIndexScratch<K, S>
impl<K, S> Debug for ReusableIndexScratch<K, S>
Auto Trait Implementations§
impl<K, S> Freeze for ReusableIndexScratch<K, S>where
S: Freeze,
impl<K, S> RefUnwindSafe for ReusableIndexScratch<K, S>where
S: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, S> Send for ReusableIndexScratch<K, S>
impl<K, S> Sync for ReusableIndexScratch<K, S>
impl<K, S> Unpin for ReusableIndexScratch<K, S>
impl<K, S> UnsafeUnpin for ReusableIndexScratch<K, S>where
S: UnsafeUnpin,
impl<K, S> UnwindSafe for ReusableIndexScratch<K, S>where
S: UnwindSafe,
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more