pub struct WebSocketClient {
pub auth_key: String,
/* private fields */
}
Fields§
§auth_key: String
Implementations§
Source§impl WebSocketClient
impl WebSocketClient
Sourcepub fn new(cluster: &str, auth_key: Option<&str>) -> Self
pub fn new(cluster: &str, auth_key: Option<&str>) -> Self
Returns a new WebSocket client.
The cluster
parameter can be one of STOCKS_CLUSTER
, FOREX_CLUSTER
,
or CRYPTO_CLUSTER
.
The auth_key
parameter optionally provides the API key to use for
authentication. If None
is provided, then the API key specified in the
POLYGON_AUTH_KEY
environment variable is used.
§Panics
This function will panic if auth_key
is None
and the
POLYGON_AUTH_KEY
environment variable is not set.
Sourcepub fn unsubscribe(&mut self, params: &Vec<&str>)
pub fn unsubscribe(&mut self, params: &Vec<&str>)
Unscribes from one or more ticker.
Auto Trait Implementations§
impl Freeze for WebSocketClient
impl RefUnwindSafe for WebSocketClient
impl Send for WebSocketClient
impl Sync for WebSocketClient
impl Unpin for WebSocketClient
impl UnwindSafe for WebSocketClient
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