Struct ws_tool::ServerBuilder
source · pub struct ServerBuilder {}Expand description
helper struct to config & construct websocket server
Implementations§
source§impl ServerBuilder
impl ServerBuilder
sourcepub fn accept<F1, F2, T, C, S>(
stream: S,
handshake_handler: F1,
codec_factory: F2
) -> Result<C, WsError>where
S: Read + Write,
F1: FnMut(Request<()>) -> Result<(Request<()>, Response<T>), WsError>,
F2: FnMut(Request<()>, S) -> Result<C, WsError>,
T: ToString + Debug,
pub fn accept<F1, F2, T, C, S>( stream: S, handshake_handler: F1, codec_factory: F2 ) -> Result<C, WsError>where S: Read + Write, F1: FnMut(Request<()>) -> Result<(Request<()>, Response<T>), WsError>, F2: FnMut(Request<()>, S) -> Result<C, WsError>, T: ToString + Debug,
wait for protocol handshake from client checking handshake & construct server