Skip to main content

to_const_value

Function to_const_value 

Source
pub fn to_const_value(
    value: impl ToConstValue,
) -> Result<ConstValueBuf, RuntimeError>
Expand description

Convert something into a ConstValueBuf.

ยงExamples

let value = rune::to_const_value((i32::MIN, u64::MAX))?;
let (a, b) = rune::from_const_value::<(i32, u64)>(&value)?;

assert_eq!(a, i32::MIN);
assert_eq!(b, u64::MAX);