Crates.io | select-rs |
lib.rs | select-rs |
version | 0.1.2 |
source | src |
created_at | 2021-11-10 09:35:11.970158 |
updated_at | 2021-11-11 07:10:53.549592 |
description | A POSIX select I/O Multiplexing Rust library. |
homepage | https://crates.io/crates/select-rs |
repository | https://github.com/b23r0/select-rs |
max_upload_size | |
id | 479570 |
size | 5,933 |
A POSIX select I/O Multiplexing Rust library.
# Cargo.toml
[dependencies]
select-rs = "0.1.0"
use select_rs::*;
fn main(){
let mut fds : FdSet = unsafe {std::mem::zeroed()};
FD_ZERO(&mut fds);
FD_SET(0 , &mut fds);
assert!(select(1, std::ptr::null_mut() , &mut fds ,std::ptr::null_mut()) > 0);
assert!(FD_ISSET(0, &mut fds));
}