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]
context: SharedContext,
svr_cfg: &ServerConfig
) -> Result<ProxyListener>
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]
context: SharedContext,
svr_cfg: &ServerConfig,
accept_opts: AcceptOpts
) -> Result<ProxyListener>
Create a ProxyListener
binding to a specific address with opts
pub fn from_listener(
context: SharedContext,
listener: TcpListener,
svr_cfg: &ServerConfig
) -> ProxyListener
[src]
context: SharedContext,
listener: TcpListener,
svr_cfg: &ServerConfig
) -> ProxyListener
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]
&self,
map_fn: F
) -> Result<(ProxyServerStream<S>, SocketAddr)> where
F: FnOnce(TcpStream) -> S,
S: AsyncRead + AsyncWrite + Unpin,
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
impl !RefUnwindSafe for ProxyListener
impl Send for ProxyListener
impl Sync for ProxyListener
impl Unpin for ProxyListener
impl !UnwindSafe for ProxyListener
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,