[][src]Type Definition viaduct::backend::ffi::FetchCallback

type FetchCallback = unsafe extern "C" fn(_: ByteBuffer) -> ByteBuffer;

Type of the callback we need callers on the other side of the FFI to provide.

Takes and returns a ffi_support::ByteBuffer. (TODO: it would be nice if we could make this take/return pointers, so that we could use JNA direct mapping. Maybe we need some kind of ThinBuffer?)

This is a bit weird, since it requires us to allow code on the other side of the FFI to allocate a ByteBuffer from us, but it works.

The code on the other side of the FFI is responsible for freeing the ByteBuffer it's passed using viaduct_destroy_bytebuffer.