Struct tcpserver::Builder[][src]

pub struct Builder<I, R, A, T> { /* fields omitted */ }

TCP server builder

Implementations

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

pub fn new(addr: A) -> Builder<I, R, A, 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(self) -> Arc<Actor<TCPServer<I, R, T>>>[src]

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

Auto Trait Implementations

impl<I, R, A, T> Dummy for Builder<I, R, A, T> where
    A: Dummy,
    I: Dummy,
    R: Dummy,
    T: Dummy

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

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

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

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

impl<I, R, A, T> UnwindSafe for Builder<I, R, A, T> where
    A: UnwindSafe,
    I: UnwindSafe,
    R: 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.