Refactor Rust code for slice-to-array operation This patch exposes rust_slice_type_p and introduces rust_slice_to_array, in preparation for subsequent patches that will need these.