Function latin1_bytes_from_id

Source
unsafe fn latin1_bytes_from_id(
    cx: *mut JSContext,
    id: jsid,
) -> Result<&'static [u8], ()>
Expand description

Returns a slice of bytes corresponding to the bytes in the provided string id. Returns an error if the id is not a string, or the string contains non-latin1 characters.

ยงSafety

The slice is only valid as long as the original id is not garbage collected.