[−][src]Struct refset::HashRefSet
A hash-set of references to an item.
Instead of inserting the item into the set, the set is "marked" with the item. Think of this as inserting a reference into the set with no lifetime.
Any type that can borrow to T
can be used to insert, and neither type needs to be Sized
.
T
need only implement Hash
.
Hashing algorithm
The hasing algorithm used is Sha512
, which is rather large (64 bytes).
At present there is no way to change the hasher used, I might implement that functionality in the future.
Implementations
impl<T: ?Sized + Hash> HashRefSet<T>
[src]
pub fn new() -> Self
[src]
Create a new empty HashRefSet
pub fn into_inner(self) -> HashSet<HashType>
[src]
Consume into the inner HashSet
.
pub fn with_capacity(cap: usize) -> Self
[src]
Create a new HashRefSet
with a capacity
pub fn insert<Q: ?Sized>(&mut self, value: &Q) -> bool where
Q: Borrow<T>,
[src]
Q: Borrow<T>,
Insert a reference into the set. The reference can be any type that borrows to T
.
Returns true
if there was no previous item, false
if there was.
pub fn remove<Q: ?Sized>(&mut self, value: &Q) -> bool where
Q: Borrow<T>,
[src]
Q: Borrow<T>,
Remove a reference from the set.
Returns true
if it existed.
pub fn contains<Q: ?Sized>(&mut self, value: &Q) -> bool where
Q: Borrow<T>,
[src]
Q: Borrow<T>,
Check if this value has been inserted into the set.
pub fn len(&self) -> usize
[src]
The number of items stored in the set
pub fn is_empty(&self) -> bool
[src]
Is the set empty
pub fn hashes_iter(&self) -> Iter<'_, HashType>
[src]
An iterator over the hashes stored in the set.
Trait Implementations
impl<T: Clone + ?Sized> Clone for HashRefSet<T>
[src]
fn clone(&self) -> HashRefSet<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug + ?Sized> Debug for HashRefSet<T>
[src]
impl<T: Default + ?Sized> Default for HashRefSet<T>
[src]
fn default() -> HashRefSet<T>
[src]
impl<T: Eq + ?Sized> Eq for HashRefSet<T>
[src]
impl<T: ?Sized + Hash> IntoIterator for HashRefSet<T>
[src]
type Item = HashType
The type of the elements being iterated over.
type IntoIter = IntoIter<HashType>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T: PartialEq + ?Sized> PartialEq<HashRefSet<T>> for HashRefSet<T>
[src]
fn eq(&self, other: &HashRefSet<T>) -> bool
[src]
fn ne(&self, other: &HashRefSet<T>) -> bool
[src]
impl<T: ?Sized + Send> Send for HashRefSet<T>
[src]
impl<T: ?Sized> StructuralEq for HashRefSet<T>
[src]
impl<T: ?Sized> StructuralPartialEq for HashRefSet<T>
[src]
impl<T: ?Sized + Send + Sync> Sync for HashRefSet<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for HashRefSet<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized> Unpin for HashRefSet<T>
impl<T: ?Sized> UnwindSafe for HashRefSet<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> I
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,