Struct futures_glib::IoChannel [] [src]

pub struct IoChannel { /* fields omitted */ }

Wrapper around the underlying glib GIOChannel type

Methods

impl IoChannel
[src]

Gets the internal buffer size.

Sets the buffer size.

If 0, then glib will pick a good size.

Returns whether this channel is buffered.

Sets whether this channel is buffered or not.

The buffering state can only be set if the channel's encoding is null. For any other encoding, the channel must be buffered.

A buffered channel can only be set unbuffered if the channel's internal buffers have been flushed. Newly created channels or channels which have returned G_IO_STATUS_EOF don't require such a flush. For write-only channels, a call to `flush is sufficient. Note that this means that socket-based channels cannot be set unbuffered once they have had data read from them.

The default state of the channel is buffered.

Returns whether the file/socket/whatever associated with channel will be closed when channel receives its final unref and is destroyed.

The default value of this is true for channels created by g_io_channel_new_file(), and false for all other channels.

Sets whether this channel will close the underlying I/O object whent he last reference goes out of scope.

Setting this flag to true for a channel you have already closed can cause problems.

Close an IO channel.

Any pending data to be written will be flushed if flush is true. The channel will not be freed until the last reference is dropped.

Creates a Source that's dispatched when condition is met for the given channel. For example, if condition is G_IO_IN, the source will be dispatched when there's data available for reading.

On Windows, polling a Source created to watch a channel for a socket puts the socket in non-blocking mode. This is a side-effect of the implementation and unavoidable.

Gets the encoding for the input/output of the channel.

The internal encoding is always UTF-8. The encoding None makes the channel safe for binary data.

Sets the encoding for the input/output of the channel. The internal encoding is always UTF-8. The default encoding for the external file is UTF-8.

The encoding None is safe to use with binary data.

Trait Implementations

impl AsRawFd for IoChannel
[src]

Extracts the raw file descriptor. Read more

impl Send for IoChannel
[src]

impl Read for IoChannel
[src]

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

🔬 This is a nightly-only experimental API. (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl<'a> Read for &'a IoChannel
[src]

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

🔬 This is a nightly-only experimental API. (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl Write for IoChannel
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

impl<'a> Write for &'a IoChannel
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

impl From<TcpStream> for IoChannel
[src]

Performs the conversion.

impl Clone for IoChannel
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Drop for IoChannel
[src]

A method called when the value goes out of scope. Read more