pub struct Builder<I, R, A, T, B, C, IST> { /* private fields */ }
Expand description
TCP server builder
Implementations§
source§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,
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>
impl<I, R, A, T, B, C, IST> Sync for Builder<I, R, A, T, B, C, IST>
impl<I, R, A, T, B, C, IST> Unpin for Builder<I, R, A, T, B, C, IST>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more