Struct ws_tool::simple::ClientConfig
source · pub struct ClientConfig {
pub read_buf: usize,
pub write_buf: usize,
pub certs: Vec<PathBuf>,
pub window: Option<WindowBit>,
pub context_take_over: bool,
pub extra_headers: HashMap<String, String>,
pub set_socket_fn: Box<dyn FnMut(&TcpStream) -> Result<(), WsError>>,
}
Expand description
client connection config
Fields§
§read_buf: usize
read buffer size
write_buf: usize
write buffer size
certs: Vec<PathBuf>
custom certification path
window: Option<WindowBit>
deflate window size, if none, deflate will be disabled
context_take_over: bool
enable/disable deflate context taker over parameter
extra_headers: HashMap<String, String>
extra header when perform websocket protocol handshake
set_socket_fn: Box<dyn FnMut(&TcpStream) -> Result<(), WsError>>
modified socket option after create tcp socket, this function will be applied before start tls session
Implementations§
source§impl ClientConfig
impl ClientConfig
sourcepub fn connect_with<C, F>(
&mut self,
uri: impl TryInto<Uri, Error = InvalidUri>,
check_fn: F
) -> Result<C, WsError>
pub fn connect_with<C, F>( &mut self, uri: impl TryInto<Uri, Error = InvalidUri>, check_fn: F ) -> Result<C, WsError>
perform websocket handshake, use custom codec
sourcepub fn connect(
&mut self,
uri: impl TryInto<Uri, Error = InvalidUri>
) -> Result<DeflateCodec<BufStream<SyncStream>>, WsError>
pub fn connect( &mut self, uri: impl TryInto<Uri, Error = InvalidUri> ) -> Result<DeflateCodec<BufStream<SyncStream>>, WsError>
perform websocket handshake
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ClientConfig
impl !Send for ClientConfig
impl !Sync for ClientConfig
impl Unpin for ClientConfig
impl !UnwindSafe for ClientConfig
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