Crate rustuvExperimental[src]
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.
Reexports
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; |
Modules
| addrinfo | |
| async | |
| file | |
| idle | |
| net | |
| pipe | |
| process | |
| signal | |
| stream | |
| timer | |
| tty | |
| uvio | The implementation of |
| uvll | Low-level bindings to the libuv library. |
Structs
| 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 |
Traits
| UvHandle | A type that wraps a uv handle |
Functions
| 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 |
Type Definitions
| Buf | The uv buffer type |