Porting a libevent C program to Rust

I have a program in C written using the libevent framework . I would like to rewrite this into Rust . This is using Unix Domain Sockets. Are there any guides / pointers on this topic . Is Tokio the best way to go about implementing this ?

Based on a cursory look at the libevent api I think the closest rust crate would be mio, which is the crate tokio uses for polling. If you want to keep the structure of the ported program close to the C original, you may want to use mio. If you are fine with restructuring the code, you will probably want to use tokio or async-std instead, which both provide a higher level interface. If you use tokio, you can use UnixListener/UnixStream or UnixDatagram depending on if you use a SOCK_STREAM or SOCK_DGRAM. If you want to send and receive file descriptors, you will have to use the raw libc api's it seems, though you can still use mio for polling. The libstd version of the api to send and receive file descriptors is unstable and tokio and async-std don't provide it at all.

I tried this . But the code does not work. It reads the first set of bytes and then does not loop again and keeps waiting . Let me know if I am missing anything obvious

     let listener = UnixListener::bind(&addr).unwrap();
    loop {
        match listener.accept().await {
            Ok((stream, _addr)) => {
                println!("New connection");
                loop {
                    let ready = stream.ready(Interest::READABLE).await?;

                    if ready.is_readable() {
                        let mut data = vec![0; chunk_size];
                        match stream.try_read(&mut data) {
                            Ok(n) => {
                                println!("read {:?} bytes", n);
                                if (n == 0) {
                                    break;
                                }
                                data.truncate(n);
                                println!("data {:?}", data);
                            }
                            Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
                                //continue;
                            }
                            Err(e) => {
                                return Err(e.into());
                            }
                       }
                    }
                }
            }

            Err(e) => { /* connection failed */ }
        }
    }