Struct cop::subst::Subst [−][src]
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,
T: RefUnwindSafe,
impl<T> Send for Subst<T> where
T: Send,
T: Send,
impl<T> Sync for Subst<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Subst<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Subst<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<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,