Skip to main content

nova_rt_bytes_from_ints

Function nova_rt_bytes_from_ints 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn nova_rt_bytes_from_ints( ints: *const u8, ) -> *mut NovaStr
Expand description

A Bytes holding each element of ints as one byte.

Aborts if any element is outside 0..=255: that is a caller error (std/ bytes’s bytes_from_ints is the only path to this intrinsic, and it documents the same contract), and a Result here would infect every construction path with a status protocol for what is a programmer mistake.

§Safety

ints must point to a Nova array of Int: { len: i64, elems… } with element i at byte offset 8 + 8*i — the layout nova_rt_str_from_chars (nova-runtime’s crate root) reads for [Char].