Struct gjio::Network [] [src]

pub struct Network {
    // some 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]

fn get_tcp_address(&self, addr: SocketAddr) -> SocketAddress

fn get_unix_address<P: AsRef<Path>>(&self, addr: P) -> Result<SocketAddressError>

fn new_socket_pair(&self) -> Result<(SocketStream, SocketStream)Error>

unsafe fn wrap_raw_socket_descriptor(&self, fd: RawDescriptor) -> Result<SocketStreamError>

fn socket_spawn<F>(&self, start_func: F) -> Result<(JoinHandle<()>, SocketStream)Box<Error>> where F: FnOnce(SocketStream, &WaitScope, EventPort) -> Result<()Box<Error>>, F: Send + 'static

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]

fn clone(&self) -> Network

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more