pub fn uniffi_rustbuffer_reserve(
    buf: RustBuffer,
    additional: u64,
    call_status: &mut RustCallStatus
) -> RustBuffer
Expand description

Reserve additional capacity in a byte buffer that had previously been passed to the foreign language code.

The first argument must be a uniquely-owned RustBuffer previously obtained from a call into the Rust code that returned a buffer. Its underlying data pointer will be reallocated if necessary and returned in a new RustBuffer struct.

The second argument must be the minimum number of additional bytes to reserve capacity for in the buffer; it is likely to reserve additional capacity in practice due to amortized growth strategy of Rust vectors.

Safety

The first argument must be a uniquely-owned RustBuffer previously obtained from a call into the Rust code that returned a buffer, or you’ll risk freeing unowned memory or corrupting the allocator state.