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.

Type addr_in

type addr_in = addr_in_impl::addr_in

Type addrinfo

type addrinfo = addrinfo_impl::addrinfo

Type handle_type

type handle_type = libc::c_uint

Type 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),}

Type sockaddr_in6

type sockaddr_in6 = {a0: *u8, a1: *u8, a2: *u8, a3: *u8,}

Type 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,}

Type uv_async_t_32bit_unix_riders

type uv_async_t_32bit_unix_riders = {a10: *u8,}

Type uv_buf_t

type uv_buf_t = {base: *u8, len: libc::size_t,}

Type uv_connect_t

type uv_connect_t = {a00: *u8, a01: *u8, a02: *u8, a03: *u8, a04: *u8, a05: *u8,}

Type uv_err_data

type uv_err_data = {err_name: str, err_msg: str,}

Type uv_err_t

type uv_err_t = {code: libc::c_int, sys_errno_: libc::c_int,}

Type 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,}

Type uv_handle_fields

type uv_handle_fields = {loop_handle: *libc::c_void,
 type_: handle_type,
 close_cb: *u8,
 mut data: *libc::c_void,}

Type uv_ip4_addr

type uv_ip4_addr = {ip: ~[u8], port: int,}

Type uv_ip6_addr

type uv_ip6_addr = uv_ip4_addr

Type uv_stream_t

type uv_stream_t = {fields: uv_handle_fields,}

Type 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,}

Type uv_tcp_t_32bit_unix_riders

type uv_tcp_t_32bit_unix_riders = {a29: *u8,}

Type 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,}

Type uv_timer_t_32bit_unix_riders

type uv_timer_t_32bit_unix_riders = {a10: *u8, a11: *u8,}

Type 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,}

Type uv_write_t_32bit_unix_riders

type uv_write_t_32bit_unix_riders = {a13: *u8,}

Enum uv_handle_type

Variants

Function accept

unsafe fn accept(server: *libc::c_void, client: *libc::c_void) -> libc::c_int

Function addrinfo_as_sockaddr_in

unsafe fn addrinfo_as_sockaddr_in(input: *addrinfo) -> *sockaddr_in

Function addrinfo_as_sockaddr_in6

unsafe fn addrinfo_as_sockaddr_in6(input: *addrinfo) -> *sockaddr_in6

Function async_init

unsafe fn async_init(loop_handle: *libc::c_void, async_handle: *uv_async_t,
                     cb: *u8) -> libc::c_int

Function async_send

unsafe fn async_send(async_handle: *uv_async_t)

Function async_t

unsafe fn async_t() -> uv_async_t

Function buf_init

unsafe fn buf_init(++input: *u8, len: uint) -> uv_buf_t

Function close

unsafe fn close<T>(handle: *T, cb: *u8)

Function connect_t

unsafe fn connect_t() -> uv_connect_t

Function err_name

unsafe fn err_name(err: *uv_err_t) -> *libc::c_char

Function free_base_of_buf

unsafe fn free_base_of_buf(buf: uv_buf_t)

Function freeaddrinfo

unsafe fn freeaddrinfo(res: *addrinfo)

Function get_INADDR_NONE

unsafe fn get_INADDR_NONE() -> u32

Function get_base_from_buf

unsafe fn get_base_from_buf(buf: uv_buf_t) -> *u8

Function get_data_for_req

unsafe fn get_data_for_req<T>(req: *T) -> *libc::c_void

Function get_data_for_uv_handle

unsafe fn get_data_for_uv_handle<T>(handle: *T) -> *libc::c_void

Function get_data_for_uv_loop

unsafe fn get_data_for_uv_loop(loop_ptr: *libc::c_void) -> *libc::c_void

Function get_last_err_data

unsafe fn get_last_err_data(uv_loop: *libc::c_void) -> uv_err_data

Function get_last_err_info

unsafe fn get_last_err_info(uv_loop: *libc::c_void) -> str

Function get_len_from_buf

unsafe fn get_len_from_buf(buf: uv_buf_t) -> libc::size_t

Function get_loop_for_uv_handle

unsafe fn get_loop_for_uv_handle<T>(handle: *T) -> *libc::c_void

Function get_next_addrinfo

unsafe fn get_next_addrinfo(input: *addrinfo) -> *addrinfo

Function get_stream_handle_from_connect_req

unsafe fn get_stream_handle_from_connect_req(connect: *uv_connect_t) ->
          *uv_stream_t

Function get_stream_handle_from_write_req

unsafe fn get_stream_handle_from_write_req(write_req: *uv_write_t) ->
          *uv_stream_t

Function getaddrinfo

unsafe 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

Function getaddrinfo_t

unsafe fn getaddrinfo_t() -> uv_getaddrinfo_t

Function ip4_addr

unsafe fn ip4_addr(ip: str, port: int) -> sockaddr_in

Function ip4_name

unsafe fn ip4_name(src: &sockaddr_in) -> str

Function ip6_addr

unsafe fn ip6_addr(ip: str, port: int) -> sockaddr_in6

Function ip6_name

unsafe fn ip6_name(src: &sockaddr_in6) -> str

Function is_ipv4_addrinfo

unsafe fn is_ipv4_addrinfo(input: *addrinfo) -> bool

Function is_ipv6_addrinfo

unsafe fn is_ipv6_addrinfo(input: *addrinfo) -> bool

Function last_error

unsafe fn last_error(loop_handle: *libc::c_void) -> uv_err_t

Function listen

unsafe fn listen<T>(stream: *T, backlog: libc::c_int, cb: *u8) -> libc::c_int

Function loop_delete

unsafe fn loop_delete(loop_handle: *libc::c_void)

Function loop_new

unsafe fn loop_new() -> *libc::c_void

Function loop_refcount

unsafe fn loop_refcount(loop_ptr: *libc::c_void) -> libc::c_int

Function malloc_buf_base_of

unsafe fn malloc_buf_base_of(suggested_size: libc::size_t) -> *u8

Function read_start

unsafe fn read_start(stream: *uv_stream_t, on_alloc: *u8, on_read: *u8) ->
          libc::c_int

Function read_stop

unsafe fn read_stop(stream: *uv_stream_t) -> libc::c_int

Function run

unsafe fn run(loop_handle: *libc::c_void)

Function set_data_for_req

unsafe fn set_data_for_req<T, U>(req: *T, data: *U)

Function set_data_for_uv_handle

unsafe fn set_data_for_uv_handle<T, U>(handle: *T, data: *U)

Function set_data_for_uv_loop

unsafe fn set_data_for_uv_loop(loop_ptr: *libc::c_void, data: *libc::c_void)

Function strerror

unsafe fn strerror(err: *uv_err_t) -> *libc::c_char

Function tcp_bind

unsafe fn tcp_bind(tcp_server_ptr: *uv_tcp_t, addr_ptr: *sockaddr_in) ->
          libc::c_int

Function tcp_bind6

unsafe fn tcp_bind6(tcp_server_ptr: *uv_tcp_t, addr_ptr: *sockaddr_in6) ->
          libc::c_int

Function tcp_connect

unsafe 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

Function tcp_connect6

unsafe 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

Function tcp_init

unsafe fn tcp_init(loop_handle: *libc::c_void, handle: *uv_tcp_t) ->
          libc::c_int

Function tcp_t

unsafe fn tcp_t() -> uv_tcp_t

Function timer_init

unsafe fn timer_init(loop_ptr: *libc::c_void, timer_ptr: *uv_timer_t) ->
          libc::c_int

Function timer_start

unsafe fn timer_start(timer_ptr: *uv_timer_t, cb: *u8, timeout: uint,
                      repeat: uint) -> libc::c_int

Function timer_stop

unsafe fn timer_stop(timer_ptr: *uv_timer_t) -> libc::c_int

Function timer_t

unsafe fn timer_t() -> uv_timer_t

Function write

unsafe fn write<T>(req: *uv_write_t, stream: *T, buf_in: *~[uv_buf_t],
                   cb: *u8) -> libc::c_int

Function write_t

unsafe fn write_t() -> uv_write_t