The current target for std::uv are a set of low-level libuv bindings,
closely mimicking the C API. Why exactly do they need to be low-level? A
large majority of the std modules are already high level, it feels kind of
odd to have a low level module in there. Wouldn't it be nicer (and just as
powerful) to have it set out like below with interfaces:

fn callback(handle: timer, status: int) {

    io::println("Done!");

}



fn main() {

    let loop = uv::mk_loop();

    let timer = uv::mk_timer(loop);



    timer.start(callback,  5000, 0);

    loop.run();

 }


vs. (based off the current state of uv.rs)

crust fn callback(handle: ctypes::intptr_t, status: ctypes::c_int) {

    io::println("Done!");

}



fn main() {

    let loop = uv::loop_new();

    let timer =  uv::timer_new();



    uv::timer_init(ptr::addr_of(loop), ptr::addr_of(timer));

    uv::timer_start(ptr::addr_of(timer), ptr::addr_of(callback),  5000, 0);

    uv::run(loop);

    uv::loop_destroy(loop);

 }


So what exactly do we need low level bindings of libuv for?
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to