[][src]Struct tcpserver::TCPServer

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

Implementations

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

pub async fn new<T: ToSocketAddrs>(
    addr: T,
    input: I
) -> Result<TCPServer<I, R>, Box<dyn Error>>
[src]

创建一个新的TCP服务

pub fn set_connection_event(&self, f: ConnectEventType)[src]

设置连接事件通知

pub async fn start<'_>(&'_ self) -> Result<(), Box<dyn Error>>[src]

启动TCP服务

Auto Trait Implementations

impl<I, R> !RefUnwindSafe for TCPServer<I, R>

impl<I, R> Send for TCPServer<I, R>

impl<I, R> !Sync for TCPServer<I, R>

impl<I, R> Unpin for TCPServer<I, R>

impl<I, R> !UnwindSafe for TCPServer<I, R>

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.