[][src]Struct gf::support::lattice::HashLattice

pub struct HashLattice<K: Clone + Hash + Eq, V: Clone + Eq> { /* fields omitted */ }

Lattice backed by a hash map.

Normally, instead of using the new constructor, it will be more useful to call Bottom::bottom or Top::top to create a new hash lattice.

If V does not implement the lattice traits, this structure can still be used as a hash map with default.

Implementations

impl<K: Clone + Hash + Eq, V: Clone + Eq> HashLattice<K, V>[src]

pub fn new(default_value: V) -> Self[src]

Create an empty hash lattice with given default value.

pub fn with_capacity(default_value: V, capacity: usize) -> Self[src]

Create an empty hash lattice with given default value and preallocated capacity.

pub fn default_value(&self) -> &V[src]

Return default value of the hash lattice.

pub fn clear(&mut self)[src]

Clear the lattice by replacing all values with the default value.

pub fn get(&self, key: &K) -> &V[src]

Return element for given key.

pub fn take(&mut self, key: &K) -> V[src]

Take element for given key leaving the default value in its place.

pub fn set(&mut self, key: K, value: V)[src]

Set element for given key.

pub fn iter(&self) -> impl Iterator<Item = (&K, &V)>[src]

Return an iterator over keys with non-default values.

pub fn set_meet(&mut self, key: K, value: &V) -> bool where
    V: Meet
[src]

Set element for given key by applying the meet operation and return if this changed the state.

pub fn set_join(&mut self, key: K, value: &V) -> bool where
    V: Join
[src]

Set element for given key by applying the join operation and return if this changed the state.

Trait Implementations

impl<K: Clone + Hash + Eq, V: Clone + Eq + Bottom> Bottom for HashLattice<K, V>[src]

impl<K: Clone + Hash + Eq, V: Clone + Eq> Clone for HashLattice<K, V>[src]

impl<K: Debug + Clone + Hash + Eq, V: Debug + Clone + Eq> Debug for HashLattice<K, V>[src]

impl<K: Eq + Clone + Hash, V: Eq + Clone> Eq for HashLattice<K, V>[src]

impl<K: Clone + Hash + Eq, V: Clone + Eq + Join> Join for HashLattice<K, V>[src]

impl<K: Clone + Hash + Eq, V: Clone + Eq + Meet> Meet for HashLattice<K, V>[src]

impl<K: PartialEq + Clone + Hash + Eq, V: PartialEq + Clone + Eq> PartialEq<HashLattice<K, V>> for HashLattice<K, V>[src]

impl<K: Clone + Hash + Eq, V: Clone + Eq> StructuralEq for HashLattice<K, V>[src]

impl<K: Clone + Hash + Eq, V: Clone + Eq> StructuralPartialEq for HashLattice<K, V>[src]

impl<K: Clone + Hash + Eq, V: Clone + Eq + Top> Top for HashLattice<K, V>[src]

Auto Trait Implementations

impl<K, V> RefUnwindSafe for HashLattice<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V> Send for HashLattice<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for HashLattice<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Unpin for HashLattice<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for HashLattice<K, V> where
    K: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.