Enum canrun::value::Val [−][src]
Expand description
The possible states a value can be in.
Variants
Tuple Fields of Var
0: LVar<T>
A resolved value.
When a state is split into an arbitrary number of resolved states, some of the internal data structures often need to be cloned. In an attempt to avoid unnecessary cloning of every value in the state, we wrap it in an Rc so that references can be shared.
Tuple Fields of Resolved
0: Rc<T>
Implementations
Attempt to extract a reference to resolved value (&T
) or return the
LVar
if the value is not yet resolved.
Examples:
use canrun::{var, val, LVar}; let x: LVar<i32> = var(); let x_val = val!(x); assert_eq!(x_val.resolved(), Err(x));
let y_val = val!(1); assert_eq!(y_val.resolved(), Ok(&1));
Return true
if the Val
is an unresolved variable.
Example:
use canrun::{var, val, Val}; let x: Val<i32> = val!(var()); assert!(x.is_var());
Return true
if the Val
is a resolved value.
Example:
use canrun::{var, val, Val}; let x: Val<i32> = val!(1); assert!(x.is_resolved());
Trait Implementations
Extract a reified Self
from a compatible
ResolvedState
. This trait is usually
used indirectly through the Query
trait. Read more
Auto Trait Implementations
impl<T> !RefUnwindSafe for Val<T>
impl<T: ?Sized> UnwindSafe for Val<T> where
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self