Trait TunnelProvider

Source
pub trait TunnelProvider:
    Sync
    + Send
    + 'static {
    type Device: Send + Unpin + AsyncRead + AsyncWrite + 'static;
    type State: Send + Sync + Clone + 'static;

    // Required methods
    fn get_device(&self) -> Result<Self::Device>;
    fn state(&self) -> Self::State;

    // Provided method
    fn protect_socket_fd(&self, _fd: i32) { ... }
}

Required Associated Types§

Source

type Device: Send + Unpin + AsyncRead + AsyncWrite + 'static

Source

type State: Send + Sync + Clone + 'static

Required Methods§

Source

fn get_device(&self) -> Result<Self::Device>

Source

fn state(&self) -> Self::State

Provided Methods§

Implementors§

Source§

impl TunnelProvider for NoopProvider

Source§

type Device = TcpStream

Source§

type State = ()

Source§

impl TunnelProvider for TunioTunnelProvider

Source§

type Device = Compat<UtunInterface<TokioFdQueue>>

Source§

type State = ()