pub trait IntoValue {
// Required method
fn into_value(self) -> Value;
}Expand description
Convert a host value into a Value. Used by the ctx! macro to
accept strings, integers, and slices without requiring the caller to
wrap each in a Value::* constructor.
This trait is intentionally narrow: impls are shipped for the common host
types and third-party extension is not expected. For bespoke types, convert
to a supported primitive first (e.g. via Display) or use the longer form
Value::String("...".into()).
Numeric conversion: i8..i64, u8..u32, and isize go through an
infallible as i64 cast (their full range fits). u64 and usize use a
saturating TryFrom conversion — values above i64::MAX clamp to
i64::MAX rather than wrapping to a negative. If you need the raw bit
pattern, construct a Value::Number(v as i64) explicitly.