Struct fuchsia_zircon::MessageBuf [] [src]

pub struct MessageBuf { /* fields omitted */ }

A buffer for receiving messages from a channel.

A MessageBuf is essentially a byte buffer and a vector of handles, but move semantics for "taking" handles requires special handling.

Note that for sending messages to a channel, the caller manages the buffers, using a plain byte slice and Vec<Handle>.

Methods

impl MessageBuf
[src]

[src]

Create a new, empty, message buffer.

[src]

Create a new non-empty message buffer.

[src]

Ensure that the buffer has the capacity to hold at least n_bytes bytes.

[src]

Ensure that the buffer has the capacity to hold at least n_handles handles.

[src]

Ensure that at least n_bytes bytes are initialized (0 fill).

[src]

Get a reference to the bytes of the message buffer, as a &[u8] slice.

[src]

The number of handles in the message buffer. Note this counts the number available when the message was received; take_handle does not affect the count.

[src]

Take the handle at the specified index from the message buffer. If the method is called again with the same index, it will return None, as will happen if the index exceeds the number of handles available.

[src]

Clear the bytes and handles contained in the buf. This will drop any contained handles, resulting in their resources being freed.

Trait Implementations

impl Default for MessageBuf
[src]

[src]

Returns the "default value" for a type. Read more

impl Debug for MessageBuf
[src]

[src]

Formats the value using the given formatter.