Struct cop::subst::Subst[][src]

pub struct Subst<T> { /* fields omitted */ }

Map from usize to T that can be efficiently restored to earlier states.

Implementations

impl<T> Subst<T>[src]

pub fn get_dom_len(&self) -> usize[src]

Return the number of assigned variables.

pub fn get_dom_max(&self) -> usize[src]

Return the maximally assignable index.

pub fn set_dom_max(&mut self, dom_max: usize)[src]

Permit the assignment of variables at least up to (excluding) the given index.

pub fn set_dom_len(&mut self, new_len: usize)[src]

Omit the most recent variable bindings to keep only the given number of bindings.

pub fn insert(&mut self, v: usize, tm: T)[src]

Assign a given variable to the given term.

Panic if the index exceeds the maximum domain.

pub fn get(&self, v: usize) -> Option<&T>[src]

Obtain a variable binding.

Panic if the index exceeds the maximum domain.

impl<T: Copy> Subst<T>[src]

pub fn fix(&self, x: T, f: impl Fn(T) -> Option<usize>) -> T[src]

Repeatedly apply substitution to a value.

The function terminates as soon as either the given function returns no index or the substitution is not defined at the index.

Trait Implementations

impl<T> Default for Subst<T>[src]

impl<T: Display> Display for Subst<T>[src]

impl<T> From<&'_ Subst<T>> for Ptr[src]

impl<T> Rewind<&'_ Ptr> for Subst<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Subst<T> where
    T: RefUnwindSafe

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

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

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

impl<T> UnwindSafe for Subst<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<T> From<T> for T[src]

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.