Skip to main content

diplomat_simple_write

Function diplomat_simple_write 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn diplomat_simple_write( buf: *mut u8, buf_size: usize, ) -> DiplomatWrite
Expand description

Create an DiplomatWrite that can write to a fixed-length stack allocated u8 buffer.

Once done, this will append a null terminator to the written string.

This is largely used internally by Diplomat-generated FFI code, and should not need to be constructed manually outside of that context. See RustWriteVec if you need this in Rust.

ยงSafety

  • buf must be a valid pointer to a region of memory that can hold at buf_size bytes