[src]

Crate rustuv

Bindings to libuv, along with the default implementation of std::rt::rtio.

UV types consist of the event loop (Loop), Watchers, Requests and Callbacks.

Watchers and Requests encapsulate pointers to uv handles, which have subtyping relationships with each other. This subtyping is reflected in the bindings with explicit or implicit coercions. For example, an upcast from TcpWatcher to StreamWatcher is done with tcp_watcher.as_stream(). In other cases a callback on a specific type of watcher will be passed a watcher of a supertype.

Currently all use of Request types (connect/write requests) are encapsulated in the bindings and don't need to be dealt with by the caller.

Safety note

Due to the complex lifecycle of uv handles, as well as compiler bugs, this module is not memory safe and requires explicit memory management, via close and delete methods.

pub use self::async::AsyncWatcher;
pub use self::file::{FsRequest, FileWatcher};
pub use self::idle::IdleWatcher;
pub use self::net::{TcpWatcher, TcpListener, TcpAcceptor, UdpWatcher};
pub use self::pipe::{PipeWatcher, PipeListener, PipeAcceptor};
pub use self::process::Process;
pub use self::signal::SignalWatcher;
pub use self::timer::TimerWatcher;
pub use self::tty::TtyWatcher;
addrinfo
async
file
idle
net
pipe
process
signal
stream
timer
tty
uvio

The implementation of rtio for libuv The implementation of rtio for libuv

uvll

C bindings to libuv C bindings to libuv Low-level bindings to the libuv library.

ForbidSwitch
ForbidUnwind
Loop

FIXME: Loop(*handle) is buggy with destructors. Normal structs with dtors may not be destructured, but tuple structs can, but the results are not correct.

Request
UvError
UvHandle

A type that wraps a uv handle

empty_buf
event_loop

Creates a new event loop which is powered by libuv

slice_to_uv_buf

Borrow a slice to a Buf

status_to_io_result
status_to_maybe_uv_error

Given a uv error code, convert a callback status to a UvError

uv_error_to_io_error
Buf

The uv buffer type