pub unsafe extern "C" fn dispatch_write(
fd: dispatch_fd_t,
data: &DispatchData,
queue: &DispatchQueue,
handler: &DynBlock<dyn Fn(*mut DispatchData, c_int)>,
)Expand description
Schedule a write operation for asynchronous execution on the specified file descriptor. The specified handler is enqueued when the operation has completed or an error occurs.
If an unrecoverable error occurs on the file descriptor, the handler will be enqueued with the appropriate error code along with the data that could not be successfully written.
An invocation of the handler with an error code of zero indicates that the data was fully written to the channel.
The system takes control of the file descriptor until the handler is enqueued, and during this time file descriptor flags such as O_NONBLOCK will be modified by the system on behalf of the application. It is an error for the application to modify a file descriptor directly while it is under the control of the system, but it may create additional dispatch I/O convenience operations or dispatch I/O channels associated with that file descriptor.
Parameter fd: The file descriptor to which to write the data.
Parameter data: The data object to write to the file descriptor.
Parameter queue: The dispatch queue to which the handler should be
submitted.
Parameter handler: The handler to enqueue when the data has been written.
param data The data that could not be written to the I/O
channel, or NULL.
param error An errno condition for the write operation or
zero if the write was successful.