#async #select #fd-set #fd-zero #fd-isset

select-rs

A POSIX select I/O Multiplexing Rust library

1 unstable release

Uses old Rust 2015

0.1.2 Nov 11, 2021
0.1.1 Nov 10, 2021
0.1.0 Nov 10, 2021

#17 in #select

MIT license

5KB
85 lines

select-rs Build Status ChatOnDiscord Crate

A POSIX select I/O Multiplexing Rust library.

Get started

# Cargo.toml
[dependencies]
select-rs = "0.1.0"

Example

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));
}

Dependencies

~220KB