[−][src]Trait canrun::value::IntoVal
Helper for converting into Val<T>
.
In order to be able to mix resolved values and logical
variables in the same state, they need
to be contained in the shared Val
enum. This trait
provides a standard way to convert various types of values into this
container enum without manual wrapping.
TLDR: If you see a function that takes IntoVal<T>
fn foo<T: Debug, TV: IntoVal<T>>(bar: TV) -> Val<T> { bar.into_val() }
That means it can take any of these types and will take care of converting
them into a Val<T>
for you:
let a: Val<i32> = foo(1); // a plain value of type `T` let b: Val<i32> = foo(var()); // an `LVar<T>` let c: Val<i32> = foo(a); // a `Val<T>`