pub struct LVar<T> { /* private fields */ }Expand description
A logical variable that represents a potential value of type T.
LVars are are passed into goals to relate
values and other variables to each other. They can also be
used to query for values.
The main reason to deal with an LVar directly as opposed to just
Value::Var is that LVar implements Copy,
which makes it more convenient when the same var is shared between various goals,
closures and other places.
The identity of each LVar is tracked using an internal id. While this id
is visible through the Debug implementation, it should only be used for
debugging purposes as no guarantees are made about the type or generation of
the id value. Also, these ids are only valid within the context of a single
execution. They cannot be safely persisted or shared between processes.
Implementations§
Trait Implementations§
impl<T: Copy> Copy for LVar<T>
impl<T: Eq> Eq for LVar<T>
Auto Trait Implementations§
impl<T> Freeze for LVar<T>
impl<T> RefUnwindSafe for LVar<T>where
T: RefUnwindSafe,
impl<T> Send for LVar<T>where
T: Send,
impl<T> Sync for LVar<T>where
T: Sync,
impl<T> Unpin for LVar<T>where
T: Unpin,
impl<T> UnwindSafe for LVar<T>where
T: UnwindSafe,
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
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>
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>
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