Module uniffi::ffi::rustbuffer

source ·

Structs§

  • Support for passing an allocated-by-Rust buffer of bytes over the FFI.

Functions§

  • This helper allocates a new byte buffer owned by the Rust code, and returns it to the foreign-language code as a RustBuffer struct. Callers must eventually free the resulting buffer, either by explicitly calling uniffi_rustbuffer_free defined below, or by passing ownership of the buffer back into Rust code.
  • Free a byte buffer that had previously been passed to the foreign language code.
  • This helper copies bytes owned by the foreign-language code into a new byte buffer owned by the Rust code, and returns it as a RustBuffer struct. Callers must eventually free the resulting buffer, either by explicitly calling the destructor defined below, or by passing ownership of the buffer back into Rust code.
  • Reserve additional capacity in a byte buffer that had previously been passed to the foreign language code.