[][src]Struct canrun::value::LVar

pub struct LVar<T: ?Sized> { /* fields omitted */ }

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]

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]

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]

type Reified = T::Reified

The "concrete" type that Self reifies to.

Auto Trait Implementations

impl<T: ?Sized> RefUnwindSafe for LVar<T> where
    T: RefUnwindSafe

impl<T: ?Sized> Send for LVar<T> where
    T: Send

impl<T: ?Sized> Sync for LVar<T> where
    T: Sync

impl<T: ?Sized> Unpin for LVar<T> where
    T: Unpin

impl<T: ?Sized> UnwindSafe for LVar<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> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,