Skip to main content

to_shmem_slice

Function to_shmem_slice 

Source
pub unsafe fn to_shmem_slice<'a, T>(
    src: impl ExactSizeIterator<Item = &'a T>,
    builder: &mut SharedMemoryBuilder,
) -> Result<*mut [T], String>
where T: ToShmem + 'a,
Expand description

Writes all the items in src into a slice in the shared memory buffer and returns a pointer to the slice.

ยงSafety

ExactSizeIterator must not lie about its length. TODO(emilio): Use TrustedLen eventually.