[−][src]Struct canrun::LVar
A logical variable that represents a potential value of type T
.
They are typically created with the var()
function.
LVars
are are passed into goals to relate
values and other variables to each other. They can also be
used to query for values in a
ResolvedState
.
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.
Implementations
impl<T> LVar<T>
[src]
pub fn new() -> LVar<T>
[src]
Create a new logical var.
The var()
function is typically used as a
shorthand.
Example:
use canrun::{LVar}; let x: LVar<i32> = LVar::new();
pub fn labeled(label: &'static str) -> LVar<T>
[src]
Create a labeled logical var.
LVars
are primarily represented by an internal id. A textual label can
assist in debugging.
No guarantees are made about the actual debug string. Two LVars
created separately are not considered to be the same, even if they
have the same label.
Examples:
use canrun::{LVar}; let x: LVar<i32> = LVar::labeled("foo"); assert!(format!("{:?}", x).contains("foo"));
let x: LVar<i32> = LVar::labeled("foo"); let y: LVar<i32> = LVar::labeled("foo"); assert_eq!(x, x); assert_ne!(x, y);
Trait Implementations
impl<T> Clone for LVar<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Copy for LVar<T>
[src]
impl<T> Debug for LVar<T>
[src]
impl<T: Default + ?Sized> Default for LVar<T>
[src]
impl<T> Eq for LVar<T>
[src]
impl<T> Hash for LVar<T>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Debug> IntoVal<T> for LVar<T>
[src]
impl<'_, T: Debug> IntoVal<T> for &'_ LVar<T>
[src]
impl<T> PartialEq<LVar<T>> for LVar<T>
[src]
impl<'a, T, D> ReifyIn<'a, D> for LVar<T> where
T: ReifyIn<'a, D> + Debug,
D: DomainType<'a, T> + 'a,
[src]
T: ReifyIn<'a, D> + Debug,
D: DomainType<'a, T> + 'a,
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for LVar<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized> Send for LVar<T> where
T: Send,
T: Send,
impl<T: ?Sized> Sync for LVar<T> where
T: Sync,
T: Sync,
impl<T: ?Sized> Unpin for LVar<T> where
T: Unpin,
T: Unpin,
impl<T: ?Sized> UnwindSafe for LVar<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,
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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,