config: make config settable at runtime

Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
pull/43/head
Alexey Galakhov 7 years ago
parent 9b0a2e0f11
commit a7e87488c4
  1. 5
      src/protocol/mod.rs

@ -108,6 +108,11 @@ impl<Stream> WebSocket<Stream> {
pub fn get_mut(&mut self) -> &mut Stream {
self.socket.get_mut()
}
/// Change the configuration.
pub fn set_config(&mut self, set_func: impl FnOnce(&mut WebSocketConfig)) {
set_func(&mut self.config)
}
}
impl<Stream> WebSocket<Stream> {

Loading…
Cancel
Save