GPollableOutputStreamInterface

The interface for pollable output streams.

The default implementation of @can_poll always returns true.

The default implementation of @write_nonblocking calls gio.pollable_output_stream.PollableOutputStream.isWritable, and then calls gio.output_stream.OutputStream.write if it returns true. This means you only need to override it if it is possible that your @is_writable implementation may return true when the stream is not actually writable.

The default implementation of @writev_nonblocking calls gio.pollable_output_stream.PollableOutputStream.writeNonblocking for each vector, and converts its return value and error (if set) to a #GPollableReturn. You should override this where possible to avoid having to allocate a #GError to return gio.types.IOErrorEnum.WouldBlock.

Members

Variables

canPoll
bool function(GPollableOutputStream* stream) canPoll;

Checks if the #GPollableOutputStream instance is actually pollable

createSource
GSource* function(GPollableOutputStream* stream, GCancellable* cancellable) createSource;

Creates a #GSource to poll the stream

gIface
GTypeInterface gIface;

The parent interface.

isWritable
bool function(GPollableOutputStream* stream) isWritable;

Checks if the stream is writable

writeNonblocking
ptrdiff_t function(GPollableOutputStream* stream, void* buffer, size_t count, GError** _err) writeNonblocking;

Does a non-blocking write or returns gio.types.IOErrorEnum.WouldBlock

writevNonblocking
GPollableReturn function(GPollableOutputStream* stream, const(GOutputVector)* vectors, size_t nVectors, size_t* bytesWritten, GError** _err) writevNonblocking;

Does a vectored non-blocking write, or returns gio.types.PollableReturn.WouldBlock