Skip to main content

js_to_rust_string

Function js_to_rust_string 

Source
pub unsafe fn js_to_rust_string(cx: *mut JSContext, val: Value) -> String
Expand description

Safe JS string conversion: returns “” if JS string allocation fails.

§Safety

Caller must ensure cx is a valid JSContext pointer and val is rooted or otherwise protected from GC.