pub struct WsConfig {
pub auth: bool,
pub base_url: Option<Url>,
pub topics: HashSet<String>,
/* private fields */
}Expand description
Configuration for WsHandler.
Should be returned by [WsHandler::ws_config()].
Fields§
§auth: boolWhether the connection should be authenticated. Normally implemented through a “listen key”
base_url: Option<Url>Prefix which will be used for connections that started using this WebSocketConfig.
Ex: "wss://example.com"
topics: HashSet<String>The topics that will be subscribed to on creation of the connection. Note that we don’t allow for passing anything that changes state here like Trade payloads, thus submissions are limited to Strings
Implementations§
Source§impl WsConfig
impl WsConfig
pub fn set_reconnect_cooldown( &mut self, reconnect_cooldown: Duration, ) -> Result<()>
pub fn set_refresh_after(&mut self, refresh_after: Duration) -> Result<()>
pub fn set_message_timeout(&mut self, message_timeout: Duration) -> Result<()>
pub fn set_response_timout(&mut self, response_timeout: Duration) -> Result<()>
Trait Implementations§
impl Eq for WsConfig
impl StructuralPartialEq for WsConfig
Auto Trait Implementations§
impl Freeze for WsConfig
impl RefUnwindSafe for WsConfig
impl Send for WsConfig
impl Sync for WsConfig
impl Unpin for WsConfig
impl UnwindSafe for WsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.