Low-level bindings to the libuv library.
This module contains a set of direct, 'bare-metal' wrappers around the libuv C-API.
Also contained herein are a set of rust records that map, in approximate memory-size, to the libuv data structures. The record implementations are adjusted, per-platform, to match their respective representations.
There are also a collection of helper functions to ease interacting with the low-level API (such as a function to return the latest libuv error as a rust-formatted string).
As new functionality, existant in uv.h, is added to the rust stdlib, the mappings should be added in this module.
This module's implementation will hopefully be, eventually, replaced with per-platform, generated source files from rust-bindgen.
addr_in
addrinfo
handle_type
sockaddr_in
sockaddr_in6
uv_async_t
uv_async_t_32bit_unix_riders
uv_buf_t
uv_connect_t
uv_err_data
uv_err_t
uv_getaddrinfo_t
uv_handle_fields
uv_ip4_addr
uv_ip6_addr
uv_stream_t
uv_tcp_t
uv_tcp_t_32bit_unix_riders
uv_timer_t
uv_timer_t_32bit_unix_riders
uv_write_t
uv_write_t_32bit_unix_riders
uv_handle_type
accept
addrinfo_as_sockaddr_in
addrinfo_as_sockaddr_in6
async_init
async_send
async_t
buf_init
close
connect_t
err_name
free_base_of_buf
freeaddrinfo
get_INADDR_NONE
get_base_from_buf
get_data_for_req
get_data_for_uv_handle
get_data_for_uv_loop
get_last_err_data
get_last_err_info
get_len_from_buf
get_loop_for_uv_handle
get_next_addrinfo
get_stream_handle_from_connect_req
get_stream_handle_from_write_req
getaddrinfo
getaddrinfo_t
ip4_addr
ip4_name
ip4_port
ip6_addr
ip6_name
ip6_port
is_ipv4_addrinfo
is_ipv6_addrinfo
last_error
listen
loop_delete
loop_new
loop_refcount
malloc_buf_base_of
read_start
read_stop
run
set_data_for_req
set_data_for_uv_handle
set_data_for_uv_loop
strerror
tcp_bind
tcp_bind6
tcp_connect
tcp_connect6
tcp_getpeername
tcp_getpeername6
tcp_init
tcp_t
timer_init
timer_start
timer_stop
timer_t
write
write_t
uv_ll::addr_in_impl
uv_ll::addrinfo_impl
uv_ll::uv_ll_struct_stubgen
uv_ll::rustrt
addr_in
type addr_in = addr_in_impl::addr_in
addrinfo
type addrinfo = addrinfo_impl::addrinfo
handle_type
type handle_type = libc::c_uint
sockaddr_in
type sockaddr_in = {mut sin_family: u16,
mut sin_port: u16,
mut sin_addr: u32,
mut sin_zero: (u8, u8, u8, u8, u8, u8, u8, u8),}
sockaddr_in6
type sockaddr_in6 = {a0: *u8, a1: *u8, a2: *u8, a3: *u8,}
uv_async_t
type uv_async_t = {fields: uv_handle_fields,
a00: *u8,
a01: *u8,
a02: *u8,
a03: *u8,
a04: *u8,
a05: *u8,
a06: *u8,
a07: *u8,
a08: *u8,
a09: *u8,
a11: uv_async_t_32bit_unix_riders,}
uv_async_t_32bit_unix_riders
type uv_async_t_32bit_unix_riders = {a10: *u8,}
uv_buf_t
type uv_buf_t = {base: *u8, len: libc::size_t,}
uv_connect_t
type uv_connect_t = {a00: *u8, a01: *u8, a02: *u8, a03: *u8, a04: *u8, a05: *u8,}
uv_err_data
type uv_err_data = {err_name: ~str, err_msg: ~str,}
uv_err_t
type uv_err_t = {code: libc::c_int, sys_errno_: libc::c_int,}
uv_getaddrinfo_t
type uv_getaddrinfo_t = {a00: *u8,
a01: *u8,
a02: *u8,
a03: *u8,
a04: *u8,
a05: *u8,
a06: *u8,
a07: *u8,
a08: *u8,}
uv_handle_fields
type uv_handle_fields = {loop_handle: *libc::c_void,
type_: handle_type,
close_cb: *u8,
mut data: *libc::c_void,}
uv_ip4_addr
type uv_ip4_addr = {ip: ~[u8], port: int,}
uv_ip6_addr
type uv_ip6_addr = uv_ip4_addr
uv_stream_t
type uv_stream_t = {fields: uv_handle_fields,}
uv_tcp_t
type uv_tcp_t = {fields: uv_handle_fields,
a00: *u8,
a01: *u8,
a02: *u8,
a03: *u8,
a04: *u8,
a05: *u8,
a06: *u8,
a07: *u8,
a08: *u8,
a09: *u8,
a10: *u8,
a11: *u8,
a12: *u8,
a13: *u8,
a14: *u8,
a15: *u8,
a16: *u8,
a17: *u8,
a18: *u8,
a19: *u8,
a20: *u8,
a21: *u8,
a22: *u8,
a23: *u8,
a24: *u8,
a25: *u8,
a26: *u8,
a27: *u8,
a28: *u8,
a30: uv_tcp_t_32bit_unix_riders,}
uv_tcp_t_32bit_unix_riders
type uv_tcp_t_32bit_unix_riders = {a29: *u8,}
uv_timer_t
type uv_timer_t = {fields: uv_handle_fields,
a00: *u8,
a01: *u8,
a02: *u8,
a03: *u8,
a04: *u8,
a05: *u8,
a06: *u8,
a07: *u8,
a08: *u8,
a09: *u8,
a11: uv_timer_t_32bit_unix_riders,}
uv_timer_t_32bit_unix_riders
type uv_timer_t_32bit_unix_riders = {a10: *u8, a11: *u8,}
uv_write_t
type uv_write_t = {fields: uv_handle_fields,
a00: *u8,
a01: *u8,
a02: *u8,
a03: *u8,
a04: *u8,
a05: *u8,
a06: *u8,
a07: *u8,
a08: *u8,
a09: *u8,
a10: *u8,
a11: *u8,
a12: *u8,
a14: uv_write_t_32bit_unix_riders,}
uv_write_t_32bit_unix_riders
type uv_write_t_32bit_unix_riders = {a13: *u8,}
uv_handle_type
UNKNOWN_HANDLE = 0
UV_TCP
UV_UDP
UV_NAMED_PIPE
UV_TTY
UV_FILE
UV_TIMER
UV_PREPARE
UV_CHECK
UV_IDLE
UV_ASYNC
UV_ARES_TASK
UV_ARES_EVENT
UV_PROCESS
UV_FS_EVENT
accept
fn accept(server: *libc::c_void, client: *libc::c_void) -> libc::c_int
addrinfo_as_sockaddr_in
fn addrinfo_as_sockaddr_in(input: *addrinfo) -> *sockaddr_in
addrinfo_as_sockaddr_in6
fn addrinfo_as_sockaddr_in6(input: *addrinfo) -> *sockaddr_in6
async_init
fn async_init(loop_handle: *libc::c_void, async_handle: *uv_async_t, cb: *u8)
-> libc::c_int
async_send
fn async_send(async_handle: *uv_async_t)
async_t
fn async_t() -> uv_async_t
buf_init
fn buf_init(input: *u8, len: uint) -> uv_buf_t
close
fn close<T>(handle: *T, cb: *u8)
connect_t
fn connect_t() -> uv_connect_t
err_name
fn err_name(err: *uv_err_t) -> *libc::c_char
free_base_of_buf
fn free_base_of_buf(buf: uv_buf_t)
freeaddrinfo
fn freeaddrinfo(res: *addrinfo)
get_INADDR_NONE
fn get_INADDR_NONE() -> u32
get_base_from_buf
fn get_base_from_buf(buf: uv_buf_t) -> *u8
get_data_for_req
fn get_data_for_req<T>(req: *T) -> *libc::c_void
get_data_for_uv_handle
fn get_data_for_uv_handle<T>(handle: *T) -> *libc::c_void
get_data_for_uv_loop
fn get_data_for_uv_loop(loop_ptr: *libc::c_void) -> *libc::c_void
get_last_err_data
fn get_last_err_data(uv_loop: *libc::c_void) -> uv_err_data
get_last_err_info
fn get_last_err_info(uv_loop: *libc::c_void) -> ~str
get_len_from_buf
fn get_len_from_buf(buf: uv_buf_t) -> libc::size_t
get_loop_for_uv_handle
fn get_loop_for_uv_handle<T>(handle: *T) -> *libc::c_void
get_next_addrinfo
fn get_next_addrinfo(input: *addrinfo) -> *addrinfo
get_stream_handle_from_connect_req
fn get_stream_handle_from_connect_req(connect: *uv_connect_t) -> *uv_stream_t
get_stream_handle_from_write_req
fn get_stream_handle_from_write_req(write_req: *uv_write_t) -> *uv_stream_t
getaddrinfo
fn getaddrinfo(loop_ptr: *libc::c_void, handle: *uv_getaddrinfo_t, cb: *u8,
node_name_ptr: *u8, service_name_ptr: *u8, hints: *addrinfo) ->
libc::c_int
getaddrinfo_t
fn getaddrinfo_t() -> uv_getaddrinfo_t
ip4_addr
fn ip4_addr(ip: &str, port: int) -> sockaddr_in
ip4_name
fn ip4_name(src: &sockaddr_in) -> ~str
ip4_port
fn ip4_port(src: &sockaddr_in) -> uint
ip6_addr
fn ip6_addr(ip: &str, port: int) -> sockaddr_in6
ip6_name
fn ip6_name(src: &sockaddr_in6) -> ~str
ip6_port
fn ip6_port(src: &sockaddr_in6) -> uint
is_ipv4_addrinfo
fn is_ipv4_addrinfo(input: *addrinfo) -> bool
is_ipv6_addrinfo
fn is_ipv6_addrinfo(input: *addrinfo) -> bool
last_error
fn last_error(loop_handle: *libc::c_void) -> uv_err_t
listen
fn listen<T>(stream: *T, backlog: libc::c_int, cb: *u8) -> libc::c_int
loop_delete
fn loop_delete(loop_handle: *libc::c_void)
loop_new
fn loop_new() -> *libc::c_void
loop_refcount
fn loop_refcount(loop_ptr: *libc::c_void) -> libc::c_int
malloc_buf_base_of
fn malloc_buf_base_of(suggested_size: libc::size_t) -> *u8
read_start
fn read_start(stream: *uv_stream_t, on_alloc: *u8, on_read: *u8) ->
libc::c_int
read_stop
fn read_stop(stream: *uv_stream_t) -> libc::c_int
run
fn run(loop_handle: *libc::c_void)
set_data_for_req
fn set_data_for_req<T, U>(req: *T, data: *U)
set_data_for_uv_handle
fn set_data_for_uv_handle<T, U>(handle: *T, data: *U)
set_data_for_uv_loop
fn set_data_for_uv_loop(loop_ptr: *libc::c_void, data: *libc::c_void)
strerror
fn strerror(err: *uv_err_t) -> *libc::c_char
tcp_bind
fn tcp_bind(tcp_server_ptr: *uv_tcp_t, addr_ptr: *sockaddr_in) -> libc::c_int
tcp_bind6
fn tcp_bind6(tcp_server_ptr: *uv_tcp_t, addr_ptr: *sockaddr_in6) ->
libc::c_int
tcp_connect
fn tcp_connect(connect_ptr: *uv_connect_t, tcp_handle_ptr: *uv_tcp_t,
addr_ptr: *sockaddr_in, after_connect_cb: *u8) -> libc::c_int
tcp_connect6
fn tcp_connect6(connect_ptr: *uv_connect_t, tcp_handle_ptr: *uv_tcp_t,
addr_ptr: *sockaddr_in6, after_connect_cb: *u8) -> libc::c_int
tcp_getpeername
fn tcp_getpeername(tcp_handle_ptr: *uv_tcp_t, name: *sockaddr_in) ->
libc::c_int
tcp_getpeername6
fn tcp_getpeername6(tcp_handle_ptr: *uv_tcp_t, name: *sockaddr_in6) ->
libc::c_int
tcp_init
fn tcp_init(loop_handle: *libc::c_void, handle: *uv_tcp_t) -> libc::c_int
tcp_t
fn tcp_t() -> uv_tcp_t
timer_init
fn timer_init(loop_ptr: *libc::c_void, timer_ptr: *uv_timer_t) -> libc::c_int
timer_start
fn timer_start(timer_ptr: *uv_timer_t, cb: *u8, timeout: uint, repeat: uint)
-> libc::c_int
timer_stop
fn timer_stop(timer_ptr: *uv_timer_t) -> libc::c_int
timer_t
fn timer_t() -> uv_timer_t
write
fn write<T>(req: *uv_write_t, stream: *T, buf_in: *~[uv_buf_t], cb: *u8) ->
libc::c_int
write_t
fn write_t() -> uv_write_t