Struct hashconsing::HConsign
source · pub struct HConsign<T: Hash + Eq + Clone, S = RandomState> { /* private fields */ }
Expand description
The consign storing the actual hash consed elements as HConsed
s.
Implementations§
source§impl<T: Hash + Eq + Clone> HConsign<T, RandomState>
impl<T: Hash + Eq + Clone> HConsign<T, RandomState>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty consign with a capacity.
source§impl<T: Hash + Eq + Clone, S> HConsign<T, S>
impl<T: Hash + Eq + Clone, S> HConsign<T, S>
sourcepub fn fold<Acc, F>(&self, init: Acc, f: F) -> Accwhere
F: FnMut(Acc, HConsed<T>) -> Acc,
pub fn fold<Acc, F>(&self, init: Acc, f: F) -> Accwhere F: FnMut(Acc, HConsed<T>) -> Acc,
Fold on the elements stored in the consign.
source§impl<T: Hash + Eq + Clone, S: BuildHasher> HConsign<T, S>
impl<T: Hash + Eq + Clone, S: BuildHasher> HConsign<T, S>
sourcepub fn with_hasher(build_hasher: S) -> Self
pub fn with_hasher(build_hasher: S) -> Self
Creates an empty consign with a custom hash
sourcepub fn with_capacity_and_hasher(capacity: usize, build_hasher: S) -> Self
pub fn with_capacity_and_hasher(capacity: usize, build_hasher: S) -> Self
Creates an empty consign with a capacity.
Trait Implementations§
source§impl<'a, T: Hash + Eq + Clone, S: BuildHasher> HashConsign<T> for &'a mut HConsign<T, S>
impl<'a, T: Hash + Eq + Clone, S: BuildHasher> HashConsign<T> for &'a mut HConsign<T, S>
source§fn mk_is_new(self, elm: T) -> (HConsed<T>, bool)
fn mk_is_new(self, elm: T) -> (HConsed<T>, bool)
Hashconses something and returns the hash consed version. Read more
source§fn shrink_to_fit(self)
fn shrink_to_fit(self)
Shrinks the capacity of the consign as much as possible.
source§fn collect_to_fit(self)
fn collect_to_fit(self)
Calls
collect
and shrink_to_fit
.Auto Trait Implementations§
impl<T, S> RefUnwindSafe for HConsign<T, S>where S: RefUnwindSafe, T: RefUnwindSafe,
impl<T, S> Send for HConsign<T, S>where S: Send, T: Send + Sync,
impl<T, S> Sync for HConsign<T, S>where S: Sync, T: Send + Sync,
impl<T, S> Unpin for HConsign<T, S>where S: Unpin, T: Unpin,
impl<T, S> UnwindSafe for HConsign<T, S>where S: UnwindSafe, T: UnwindSafe + RefUnwindSafe,
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