struct UniqueVec<T: Clone + Hash + Eq> {
items: Vec<T>,
index: HashMap<T, usize>,
}Expand description
An array of objects with the following properties:
- each item appears only once
- efficient insertion and lookup of indexes of existing items
- insertion order is maintained, indexes are stable across modification
- can do .as_bytes() for items that are IntoBytes + Immutable
Fields§
§items: Vec<T>§index: HashMap<T, usize>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for UniqueVec<T>
impl<T> RefUnwindSafe for UniqueVec<T>where
T: RefUnwindSafe,
impl<T> Send for UniqueVec<T>where
T: Send,
impl<T> Sync for UniqueVec<T>where
T: Sync,
impl<T> Unpin for UniqueVec<T>where
T: Unpin,
impl<T> UnwindSafe for UniqueVec<T>where
T: 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