Struct magenta::Socket [] [src]

pub struct Socket(_);

An object representing a Magenta socket.

As essentially a subtype of Handle, it can be freely interconverted.

Methods

impl Socket
[src]

Create a socket, accessed through a pair of endpoints. Data written into one may be read from the other.

Wraps mx_socket_create.

Write the given bytes into the socket. Return value (on success) is number of bytes actually written.

Wraps mx_socket_write.

Read the given bytes from the socket. Return value (on success) is number of bytes actually read.

Wraps mx_socket_read.

Close half of the socket, so attempts by the other side to write will fail.

Implements the MX_SOCKET_HALF_CLOSE option of mx_socket_write.

Trait Implementations

impl Debug for Socket
[src]

Formats the value using the given formatter.

impl Eq for Socket
[src]

impl PartialEq for Socket
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl AsHandleRef for Socket
[src]

Get a reference to the handle. One important use of such a reference is for object_wait_many. Read more

Interpret the reference as a raw handle (an integer type). Two distinct handles will have different raw values (so it can perhaps be used as a key in a data structure). Read more

Set and clear userspace-accessible signal bits on an object. Wraps the mx_object_signal syscall. Read more

Waits on a handle. Wraps the mx_object_wait_one syscall. Read more

Causes packet delivery on the given port when the object changes state and matches signals. mx_object_wait_async syscall. Read more

impl From<Handle> for Socket
[src]

Performs the conversion.

impl Into<Handle> for Socket
[src]

Performs the conversion.

impl HandleBased for Socket
[src]

Duplicate a handle, possibly reducing the rights available. Wraps the mx_handle_duplicate syscall. Read more

Create a replacement for a handle, possibly reducing the rights available. This invalidates the original handle. Wraps the mx_handle_replace syscall. Read more

impl Peered for Socket
[src]

Set and clear userspace-accessible signal bits on the object's peer. Wraps the mx_object_signal_peer syscall. Read more