[−][src]Struct gf::ai::state::VarState
🟢 Map-like structure for maintaining abstract state of variables.
Internally, this is a thin adapter over a HashLattice
where keys are
Var
s.
Implementations
impl<T: Clone + Eq> VarState<T>
[src]
pub fn clear(&mut self)
[src]
Clear variable state to all default (⊥ or ⊤) values.
pub fn get(&self, var: Var) -> &T
[src]
Return variable state.
pub fn get_vec(&self, vars: &[Var]) -> Vec<T>
[src]
Return a vector of cloned variable states.
pub fn take(&mut self, var: Var) -> T
[src]
Return variable state leaving the default (⊥ or ⊤) value in its place.
pub fn set(&mut self, var: Var, state: T)
[src]
Set variable state.
pub fn copy(&mut self, source_var: Var, target_var: Var)
[src]
Copy state from source_var
to target_var
.
pub fn edge<D: Direction>(&mut self, edge: Edge<'_>)
[src]
Propagate state across an intraprocedural edge.
This method is a drop-in implementation for Interp::edge
, or a part
thereof.
pub fn call<D: Direction>(&self, stmt: Stmt<'_, Call>) -> Self
[src]
Propagate state across a CALL statement.
This method is a drop-in implementation for Interp::call
.
pub fn call_ret<D: Direction>(
&mut self,
callee_state: Self,
stmt: Stmt<'_, Call>
)
[src]
&mut self,
callee_state: Self,
stmt: Stmt<'_, Call>
)
Propagate state across a return from a CALL statement.
This method is a drop-in implementation for [Interp::call_ret
].
pub fn mix<D: Direction>(&mut self, stmt: Stmt<'_, Mix>)
[src]
Propagate state across a MIX statement.
This method is a drop-in implementation for Interp::mix
.
Trait Implementations
impl<T: Clone + Eq + Bottom> Bottom for VarState<T>
[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<T: Clone + Eq> Clone for VarState<T>
[src]
impl<T: Debug + Clone + Eq> Debug for VarState<T>
[src]
impl<T: Eq + Clone> Eq for VarState<T>
[src]
impl<T: Clone + Eq + Join> Join for VarState<T>
[src]
impl<T: Clone + Eq + Meet> Meet for VarState<T>
[src]
impl<T: PartialEq + Clone + Eq> PartialEq<VarState<T>> for VarState<T>
[src]
impl<T: Clone + Eq> StructuralEq for VarState<T>
[src]
impl<T: Clone + Eq> StructuralPartialEq for VarState<T>
[src]
impl<T: Clone + Eq + Top> Top for VarState<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for VarState<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for VarState<T> where
T: Send,
T: Send,
impl<T> Sync for VarState<T> where
T: Sync,
T: Sync,
impl<T> Unpin for VarState<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for VarState<T> where
T: UnwindSafe,
T: 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>,