Skip to main content

get_buffer_source_slice

Function get_buffer_source_slice 

Source
pub(crate) fn get_buffer_source_slice<'a>(
    source: &'a ArrayBufferViewOrArrayBuffer,
    no_gc: &'a NoGC,
) -> &'a [u8] 
Expand description

Returns a slice referencing the bytes in the buffer source, without copying.

Use this instead of get_buffer_source_copy when the data is consumed synchronously — it avoids the allocation of a Vec<u8>.