Struct gjio::Network [] [src]

pub struct Network { /* fields omitted */ }

Mediates the creation of async-enabled sockets.

It is good practice to limit the use of this struct to high-level startup code and user interaction.

Methods

impl Network
[src]

Transforms the std::net::TcpStream into a SocketStream.

Wraps a raw file descriptor into a SocketStream. The SocketStream assumes ownership over the descriptor and will close it when the SocketStream is dropped. This method is unsafe because the caller needs to ensure that the descriptor is valid and not owned by anyone else.

A safer (and windows-compatible) way to transform a TcpStream into a SocketStream is via wrap_std_tcp_stream.

Creates a new thread and sets up a socket pair that can be used to communicate with it. Passes one of the sockets to the thread's start function and returns the other socket. The new thread will already have an active event loop when start_func is called.

Trait Implementations

impl Clone for Network
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more