GhosttyWriterFn typedef

Write bytes to a destination.

Returning true means all @p len bytes were accepted. Returning false reports a fatal write error. A callback wrapping an interface that permits partial writes must retry internally until the full slice is accepted or an error occurs.

On failure, the destination may already contain a prefix of the bytes. The calling operation fails and must not be resumed from that partial output. The library does not inspect or modify errno.

@p data is borrowed and valid only for the duration of the callback. The callback is invoked synchronously on the calling thread. Successful return means the bytes were handed to the destination; it does not imply that the destination was flushed or made durable.

@param userdata Opaque userdata from GhosttyWriter @param data Source bytes; always non-NULL @param len Number of source bytes; always greater than zero @return true if the complete slice was accepted, false on fatal error

Implementation

typedef GhosttyWriterFn =
    ffi.Pointer<ffi.NativeFunction<GhosttyWriterFnFunction>>;