pub struct ReadyState { /* private fields */ }
Expand description
Implementations§
Source§impl ReadyState
impl ReadyState
Sourcepub fn resolve<T: Unify>(&self, val: &Value<T>) -> Value<T>
pub fn resolve<T: Unify>(&self, val: &Value<T>) -> Value<T>
Recursively resolve a Value
as far as the currently
known variable bindings allow.
See crate::State::resolve
for more details.
Sourcepub fn reify<T, R>(&self, value: &T) -> Option<R>where
T: Reify<Reified = R>,
pub fn reify<T, R>(&self, value: &T) -> Option<R>where
T: Reify<Reified = R>,
Attempt to reify the value of a logic
variable in a ReadyState
.
§Example:
use canrun::{State, StateIterator, Value, LVar};
let x = LVar::new();
let state = State::new()
.unify(&x.into(), &Value::new(1));
let results: Vec<_> = state.into_states()
.filter_map(|s| s.ready())
.map(|resolved| resolved.reify(&x))
.collect();
assert_eq!(results, vec![Some(1)]);
Trait Implementations§
Source§impl Clone for ReadyState
impl Clone for ReadyState
Source§fn clone(&self) -> ReadyState
fn clone(&self) -> ReadyState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ReadyState
impl !RefUnwindSafe for ReadyState
impl !Send for ReadyState
impl !Sync for ReadyState
impl Unpin for ReadyState
impl !UnwindSafe for ReadyState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more