ios-core 0.1.7

High-level device API, pairing transport, and discovery for iOS devices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(feature = "tunnel-kernel")]
pub mod kernel;
#[cfg(feature = "tunnel-userspace")]
pub mod userspace;

use crate::tunnel::TunnelError;

/// Abstraction over kernel TUN and userspace (smoltcp) network devices.
pub trait TunDevice: Send + 'static {
    fn read_packet(
        &mut self,
    ) -> impl std::future::Future<Output = Result<Vec<u8>, TunnelError>> + Send;
    fn write_packet(
        &mut self,
        packet: &[u8],
    ) -> impl std::future::Future<Output = Result<(), TunnelError>> + Send;
}