pub struct IndexGen<I> {
count: AtomicUsize,
_marker: PhantomData<I>,
}
Expand description
A generator of fresh indices.
It can generate any index created with the newtype_index
macro.
If you use more than one IndexGen
uniqueness is only guaranteed for indices that come from
the same generator.
Fields§
§count: AtomicUsize
§_marker: PhantomData<I>
Implementations§
Source§impl<I: Idx> IndexGen<I>
impl<I: Idx> IndexGen<I>
pub fn new() -> Self
pub fn skipping(skip: usize) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<I> !Freeze for IndexGen<I>
impl<I> RefUnwindSafe for IndexGen<I>where
I: RefUnwindSafe,
impl<I> Send for IndexGen<I>where
I: Send,
impl<I> Sync for IndexGen<I>where
I: Sync,
impl<I> Unpin for IndexGen<I>where
I: Unpin,
impl<I> UnwindSafe for IndexGen<I>where
I: 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