pub struct BucketArrayPair<'a, 'b, const N: usize, const CAP: usize, C: Count, A: Copy, B: Copy> { /* private fields */ }
Available on crate feature
bucket-array
only.Expand description
Concrete binding between one [BucketState
] and a pair of BucketArrayMemory
Implementations§
Source§impl<'a, 'b, const N: usize, const CAP: usize, C: Count, A: Copy, B: Copy> BucketArrayPair<'a, 'b, N, CAP, C, A, B>
impl<'a, 'b, const N: usize, const CAP: usize, C: Count, A: Copy, B: Copy> BucketArrayPair<'a, 'b, N, CAP, C, A, B>
Sourcepub fn new(
mem_a: &'a mut BucketArrayMemory<N, CAP, A>,
mem_b: &'b mut BucketArrayMemory<N, CAP, B>,
) -> Self
pub fn new( mem_a: &'a mut BucketArrayMemory<N, CAP, A>, mem_b: &'b mut BucketArrayMemory<N, CAP, B>, ) -> Self
A new BucketArray
wraps a new [BucketState
] and two BucketArrayMemory
Sourcepub fn item_range(&self, bucket: usize) -> Range<usize>
pub fn item_range(&self, bucket: usize) -> Range<usize>
Look up the valid item range for a particular bucket.
Panics if the bucket index is out of range.
Sourcepub fn item_value_first(&self, bucket: usize, item: usize) -> A
pub fn item_value_first(&self, bucket: usize, item: usize) -> A
Look up the first value for one item in one bucket.
Panics if the indices are out of range.
Sourcepub fn item_value_second(&self, bucket: usize, item: usize) -> B
pub fn item_value_second(&self, bucket: usize, item: usize) -> B
Look up the second value for one item in one bucket.
Panics if the indices are out of range.
Sourcepub fn insert(&mut self, bucket: usize, first: A, second: B) -> Result<(), ()>
pub fn insert(&mut self, bucket: usize, first: A, second: B) -> Result<(), ()>
Append a new item pair to a bucket.
If the bucket is full, returns Err(()) and makes no changes.
Sourcepub fn drop_first(self) -> BucketArray<'b, N, CAP, C, B>
pub fn drop_first(self) -> BucketArray<'b, N, CAP, C, B>
Transfer the [BucketState
] to a new single BucketArray
,
keeping the second half and dropping the first.
Auto Trait Implementations§
impl<'a, 'b, const N: usize, const CAP: usize, C, A, B> Freeze for BucketArrayPair<'a, 'b, N, CAP, C, A, B>where
C: Freeze,
impl<'a, 'b, const N: usize, const CAP: usize, C, A, B> RefUnwindSafe for BucketArrayPair<'a, 'b, N, CAP, C, A, B>
impl<'a, 'b, const N: usize, const CAP: usize, C, A, B> Send for BucketArrayPair<'a, 'b, N, CAP, C, A, B>
impl<'a, 'b, const N: usize, const CAP: usize, C, A, B> Sync for BucketArrayPair<'a, 'b, N, CAP, C, A, B>
impl<'a, 'b, const N: usize, const CAP: usize, C, A, B> Unpin for BucketArrayPair<'a, 'b, N, CAP, C, A, B>where
C: Unpin,
impl<'a, 'b, const N: usize, const CAP: usize, C, A, B> !UnwindSafe for BucketArrayPair<'a, 'b, N, CAP, C, A, B>
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