pub struct Builder<I, R, A, T> { /* private fields */ }
Expand description
websocket server builder
Implementations§
Source§impl<I, R, A, T> Builder<I, R, A, T>where
I: Fn(SplitStream<WebSocketStream<MaybeRustlsStream<TcpStream>>>, Arc<Actor<WSPeer>>, T) -> R + Send + Sync + 'static,
R: Future<Output = Result<()>> + Send + 'static,
A: ToSocketAddrs,
T: Clone + Send + 'static,
impl<I, R, A, T> Builder<I, R, A, T>where
I: Fn(SplitStream<WebSocketStream<MaybeRustlsStream<TcpStream>>>, Arc<Actor<WSPeer>>, T) -> R + Send + Sync + 'static,
R: Future<Output = Result<()>> + Send + 'static,
A: ToSocketAddrs,
T: Clone + Send + 'static,
pub fn new(addr: A) -> Builder<I, R, A, T>
Sourcepub fn set_input_event(self, f: I) -> Self
pub fn set_input_event(self, f: I) -> Self
设置websocket server 输入事件
Sourcepub fn set_connect_event(self, c: ConnectEventType) -> Self
pub fn set_connect_event(self, c: ConnectEventType) -> Self
设置TCP server 连接事件
Sourcepub fn set_tls(self, tls: Option<TlsAcceptor>) -> Self
pub fn set_tls(self, tls: Option<TlsAcceptor>) -> Self
设置TCP server 连接事件
Sourcepub fn set_config(self, config: WebSocketConfig) -> Self
pub fn set_config(self, config: WebSocketConfig) -> Self
设置config
Sourcepub fn set_load_timeout(self, load_timeout_secs: u64) -> Self
pub fn set_load_timeout(self, load_timeout_secs: u64) -> Self
设置等待websocket hand accept 加载 等待时间
Sourcepub async fn build(self) -> Arc<Actor<WebSocketServer<I, R, T>>>
pub async fn build(self) -> Arc<Actor<WebSocketServer<I, R, T>>>
生成TCPSERVER,如果没有设置 tcp input 将报错
Auto Trait Implementations§
impl<I, R, A, T> Freeze for Builder<I, R, A, T>
impl<I, R, A, T> !RefUnwindSafe for Builder<I, R, A, T>
impl<I, R, A, T> Send for Builder<I, R, A, T>
impl<I, R, A, T> Sync for Builder<I, R, A, T>
impl<I, R, A, T> Unpin for Builder<I, R, A, T>
impl<I, R, A, T> !UnwindSafe for Builder<I, R, A, T>
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