pub struct PolygonWebSocket { /* private fields */ }Expand description
Polygon WebSocket client with high-performance streaming
Implementations§
Source§impl PolygonWebSocket
impl PolygonWebSocket
Sourcepub async fn subscribe(
&self,
symbols: Vec<String>,
channels: Vec<PolygonChannel>,
) -> Result<()>
pub async fn subscribe( &self, symbols: Vec<String>, channels: Vec<PolygonChannel>, ) -> Result<()>
Subscribe to market data channels
Sourcepub fn stream(&self) -> impl Stream<Item = PolygonEvent>
pub fn stream(&self) -> impl Stream<Item = PolygonEvent>
Get event stream
Sourcepub fn quote_stream(&self) -> impl Stream<Item = Result<Quote>>
pub fn quote_stream(&self) -> impl Stream<Item = Result<Quote>>
Get quote stream (filtered)
Sourcepub fn trade_stream(&self) -> impl Stream<Item = Result<Trade>>
pub fn trade_stream(&self) -> impl Stream<Item = Result<Trade>>
Get trade stream (filtered)
Sourcepub fn bar_stream(&self) -> impl Stream<Item = Result<Bar>>
pub fn bar_stream(&self) -> impl Stream<Item = Result<Bar>>
Get aggregate bar stream (filtered)
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if connection is active
Sourcepub fn get_subscriptions(&self) -> Vec<(String, Vec<PolygonChannel>)>
pub fn get_subscriptions(&self) -> Vec<(String, Vec<PolygonChannel>)>
Get active subscriptions
Auto Trait Implementations§
impl Freeze for PolygonWebSocket
impl !RefUnwindSafe for PolygonWebSocket
impl Send for PolygonWebSocket
impl Sync for PolygonWebSocket
impl Unpin for PolygonWebSocket
impl !UnwindSafe for PolygonWebSocket
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