Struct shadowsocks::relay::tcprelay::proxy_listener::ProxyListener[][src]

pub struct ProxyListener { /* fields omitted */ }

A TCP listener for accepting shadowsocks’ client connection

Implementations

impl ProxyListener[src]

pub async fn bind(
    context: SharedContext,
    svr_cfg: &ServerConfig
) -> Result<ProxyListener>
[src]

Create a ProxyListener binding to a specific address

pub async fn bind_with_opts(
    context: SharedContext,
    svr_cfg: &ServerConfig,
    accept_opts: AcceptOpts
) -> Result<ProxyListener>
[src]

Create a ProxyListener binding to a specific address with opts

pub fn from_listener(
    context: SharedContext,
    listener: TcpListener,
    svr_cfg: &ServerConfig
) -> ProxyListener
[src]

Create a ProxyListener from a TcpListener

pub async fn accept(&self) -> Result<(ProxyServerStream<TcpStream>, SocketAddr)>[src]

Accepts a shadowsocks’ client connection

pub async fn accept_map<F, S>(
    &self,
    map_fn: F
) -> Result<(ProxyServerStream<S>, SocketAddr)> where
    F: FnOnce(TcpStream) -> S,
    S: AsyncRead + AsyncWrite + Unpin
[src]

Accepts a shadowsocks’ client connection and maps the accepted TcpStream to another stream type

pub fn local_addr(&self) -> Result<SocketAddr>[src]

Get local binded address

pub fn get_ref(&self) -> &TcpListener[src]

Get reference to the internal listener

pub fn into_inner(self) -> TcpListener[src]

Consumes the ProxyListener and return the internal listener

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,