pub struct Builder<I, R, A, T, B, C, IST> { /* private fields */ }Expand description
TCP server builder
Implementations
sourceimpl<I, R, A, T, B, C, IST> Builder<I, R, A, T, B, C, IST> where
I: Fn(ReadHalf<C>, Arc<Actor<TCPPeer<C>>>, T) -> R + Send + Sync + 'static,
R: Future<Output = Result<()>> + Send + 'static,
A: ToSocketAddrs,
T: Clone + Send + 'static,
B: Future<Output = Result<C>> + Send + 'static,
C: AsyncRead + AsyncWrite + Send + 'static,
IST: Fn(TcpStream) -> B + Send + Sync + 'static,
impl<I, R, A, T, B, C, IST> Builder<I, R, A, T, B, C, IST> where
I: Fn(ReadHalf<C>, Arc<Actor<TCPPeer<C>>>, T) -> R + Send + Sync + 'static,
R: Future<Output = Result<()>> + Send + 'static,
A: ToSocketAddrs,
T: Clone + Send + 'static,
B: Future<Output = Result<C>> + Send + 'static,
C: AsyncRead + AsyncWrite + Send + 'static,
IST: Fn(TcpStream) -> B + Send + Sync + 'static,
pub fn new(addr: A) -> Builder<I, R, A, T, B, C, IST>
sourcepub fn set_input_event(self, f: I) -> Self
pub fn set_input_event(self, f: I) -> Self
设置TCP server 输入事件
sourcepub fn set_connect_event(self, c: ConnectEventType) -> Self
pub fn set_connect_event(self, c: ConnectEventType) -> Self
设置TCP server 连接事件
sourcepub fn set_stream_init(self, c: IST) -> Self
pub fn set_stream_init(self, c: IST) -> Self
设置输入流类型,例如TCPStream,SSLStream or GZIPStream
Auto Trait Implementations
impl<I, R, A, T, B, C, IST> RefUnwindSafe for Builder<I, R, A, T, B, C, IST> where
A: RefUnwindSafe,
B: RefUnwindSafe,
C: RefUnwindSafe,
I: RefUnwindSafe,
IST: RefUnwindSafe,
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, R, A, T, B, C, IST> Send for Builder<I, R, A, T, B, C, IST> where
A: Send,
B: Send,
C: Send,
I: Send,
IST: Send,
R: Send,
T: Send,
impl<I, R, A, T, B, C, IST> Sync for Builder<I, R, A, T, B, C, IST> where
A: Sync,
B: Sync,
C: Sync,
I: Sync,
IST: Sync,
R: Sync,
T: Sync,
impl<I, R, A, T, B, C, IST> Unpin for Builder<I, R, A, T, B, C, IST> where
A: Unpin,
B: Unpin,
C: Unpin,
I: Unpin,
IST: Unpin,
R: Unpin,
T: Unpin,
impl<I, R, A, T, B, C, IST> UnwindSafe for Builder<I, R, A, T, B, C, IST> where
A: UnwindSafe,
B: UnwindSafe,
C: UnwindSafe,
I: UnwindSafe,
IST: UnwindSafe,
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more