pub struct SliceSet<T: Copy + Hash + Eq + 'static> { /* private fields */ }Expand description
Holds unique slices and provides handles to fetch them later.
Implementations§
Source§impl<T: Copy + Hash + Eq + 'static> SliceSet<T>
impl<T: Copy + Hash + Eq + 'static> SliceSet<T>
pub fn try_with_capacity(capacity: usize) -> Result<Self, SetError>
Sourcepub unsafe fn insert_unique_uncontended(
&mut self,
slice: &[T],
) -> Result<ThinSlice<'static, T>, SetError>
pub unsafe fn insert_unique_uncontended( &mut self, slice: &[T], ) -> Result<ThinSlice<'static, T>, SetError>
§Safety
The slice must not already exist within the set.
Sourcepub unsafe fn insert_unique_uncontended_with_hash(
&mut self,
hash: u64,
slice: &[T],
) -> Result<ThinSlice<'static, T>, SetError>
pub unsafe fn insert_unique_uncontended_with_hash( &mut self, hash: u64, slice: &[T], ) -> Result<ThinSlice<'static, T>, SetError>
§Safety
- The hash must be the same as if the slice was re-hashed with the hasher the slice set would use.
- The slice must not already exist within the set.
Sourcepub fn try_insert(
&mut self,
slice: &[T],
) -> Result<ThinSlice<'static, T>, SetError>where
T: Hash,
pub fn try_insert(
&mut self,
slice: &[T],
) -> Result<ThinSlice<'static, T>, SetError>where
T: Hash,
Adds the slice to the slice set if it isn’t present already, and returns a handle to the slice that can be used to retrieve it later.
Auto Trait Implementations§
impl<T> !Freeze for SliceSet<T>
impl<T> !RefUnwindSafe for SliceSet<T>
impl<T> Send for SliceSet<T>
impl<T> !Sync for SliceSet<T>
impl<T> Unpin for SliceSet<T>where
T: Unpin,
impl<T> !UnwindSafe for SliceSet<T>
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