Add Read and Write for Async TunInterface

Those features are implemented using AsyncFD. While write doesn't
require a mutable reference to self, read does.

Make Async Tun a feature

remove async tun from workspace

rename write/read to send/recv
This commit is contained in:
JettChenT 2023-06-19 22:45:25 +08:00 committed by Conrad Kramer
parent d3882bd008
commit beae8c0f79
12 changed files with 135 additions and 64 deletions

View file

@ -1,6 +1,6 @@
use fehler::throws;
use std::io::Error;
use std::net::{Ipv4Addr, Ipv6Addr};
use std::net::{Ipv4Addr};
use tun::TunInterface;
#[test]
@ -23,6 +23,7 @@ fn test_set_get_ipv4() {
#[test]
#[throws]
#[cfg(target_os = "linux")]
fn test_set_get_ipv6() {
let tun = TunInterface::new()?;