Struct tcpserver::Builder [−][src]
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]
I: Fn(OwnedReadHalf, Arc<Actor<TCPPeer>>, T) -> R + Send + Sync + 'static,
R: Future<Output = ()> + Send + 'static,
A: ToSocketAddrs,
T: Clone + Send + 'static,
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,
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,
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,
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,
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,
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,
A: UnwindSafe,
I: UnwindSafe,
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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>,