[][src]Struct gf::ai::state::VarState

pub struct VarState<T: Clone + Eq> { /* fields omitted */ }

🟢 Map-like structure for maintaining abstract state of variables.

Internally, this is a thin adapter over a HashLattice where keys are Vars.

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]

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]

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

impl<T> Send for VarState<T> where
    T: Send

impl<T> Sync for VarState<T> where
    T: Sync

impl<T> Unpin for VarState<T> where
    T: Unpin

impl<T> UnwindSafe for VarState<T> where
    T: 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.