[][src]Trait hashconsing::HashConsign

pub trait HashConsign<T: Hash>: Sized {
    fn mk_is_new(self, elm: T) -> (HConsed<T>, bool);

    fn mk(self, elm: T) -> HConsed<T> { ... }
}

HConsed element creation.

Implemented via a trait to be able to extend RwLock for lazy static consigns.

Required methods

fn mk_is_new(self, elm: T) -> (HConsed<T>, bool)

Hashconses something and returns the hash consed version.

Returns true iff the element

  • was not in the consign at all, or
  • was in the consign but it is not referenced (weak ref cannot be upgraded.)
Loading content...

Provided methods

fn mk(self, elm: T) -> HConsed<T>

Creates a HConsed element.

Loading content...

Implementations on Foreign Types

impl<'a, T: Hash + Eq + Clone> HashConsign<T> for &'a RwLock<HConsign<T>>[src]

fn mk_is_new(self, elm: T) -> (HConsed<T>, bool)[src]

If the element is already in the consign, only read access will be requested.

fn mk(self, elm: T) -> HConsed<T>[src]

Loading content...

Implementors

impl<'a, T: Hash + Eq + Clone> HashConsign<T> for &'a mut HConsign<T>[src]

fn mk_is_new(self, elm: T) -> (HConsed<T>, bool)[src]

Hash conses something and returns the hash consed version.

fn mk(self, elm: T) -> HConsed<T>[src]

Loading content...