[−][src]Struct gf::support::lattice::HashLattice
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]
V: Meet,
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]
V: Join,
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]
fn bottom() -> Self
[src]
fn is_bottom(&self) -> bool
[src]
fn to_option(self) -> Option<Self>
[src]
fn reset_to_bottom(&mut self)
[src]
impl<K: Clone + Hash + Eq, V: Clone + Eq> Clone for HashLattice<K, V>
[src]
fn clone(&self) -> HashLattice<K, V>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn eq(&self, other: &HashLattice<K, V>) -> bool
[src]
fn ne(&self, other: &HashLattice<K, V>) -> bool
[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,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for HashLattice<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for HashLattice<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for HashLattice<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for HashLattice<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,