Function to_value

Source
pub fn to_value<'j, C, V>(cx: &mut C, value: &V) -> Result<Handle<'j, JsValue>>
where C: Context<'j>, V: Serialize + ?Sized,
Expand description

Converts a value of type V to a JsValue

§Errors

  • NumberCastError trying to serialize a u64 can fail if it overflows in a cast to f64
  • StringTooLong if the string exceeds v8’s max string size