[][src]Struct tcpserver::Builder

pub struct Builder<I, R, T> where
    I: Fn(TCPPeer) -> R + Send + Sync + 'static,
    R: Future<Output = ()> + Send,
    T: ToSocketAddrs
{ /* fields omitted */ }

TCP server builder

Implementations

impl<I, R, T> Builder<I, R, T> where
    I: Fn(TCPPeer) -> R + Send + Sync + 'static,
    R: Future<Output = ()> + Send,
    T: ToSocketAddrs
[src]

pub fn new(addr: T) -> Builder<I, R, T>[src]

pub fn set_input_event(self, f: I) -> Self[src]

设置TCP server 输入事件

pub fn set_connect_event(self, c: ConnectEventType) -> Self[src]

设置TCP server 连接事件

pub async fn build(__arg0: Self) -> TCPServer<I, R>[src]

生成TCPSERVER,如果没有设置 tcp input 将报错

Auto Trait Implementations

impl<I, R, T> RefUnwindSafe for Builder<I, R, T> where
    I: RefUnwindSafe,
    T: RefUnwindSafe

impl<I, R, T> Send for Builder<I, R, T> where
    T: Send

impl<I, R, T> Sync for Builder<I, R, T> where
    T: Sync

impl<I, R, T> Unpin for Builder<I, R, T> where
    I: Unpin,
    T: Unpin

impl<I, R, T> UnwindSafe for Builder<I, R, T> where
    I: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

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

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.