pub struct PolygonClient { /* private fields */ }Expand description
Polygon.io client for market data
Implementations§
Source§impl PolygonClient
impl PolygonClient
Sourcepub fn new(config: PolygonConfig) -> Self
pub fn new(config: PolygonConfig) -> Self
Create a new Polygon.io client
Sourcepub async fn get_last_quote(
&self,
symbol: &str,
) -> Result<PolygonQuote, PolygonError>
pub async fn get_last_quote( &self, symbol: &str, ) -> Result<PolygonQuote, PolygonError>
Get last quote for a symbol
Sourcepub async fn get_daily_aggregates(
&self,
symbol: &str,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Result<Vec<PolygonAggregate>, PolygonError>
pub async fn get_daily_aggregates( &self, symbol: &str, from: DateTime<Utc>, to: DateTime<Utc>, ) -> Result<Vec<PolygonAggregate>, PolygonError>
Get daily aggregates (OHLCV) for a symbol
Sourcepub async fn get_aggregates(
&self,
symbol: &str,
multiplier: u32,
timespan: &str,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Result<Vec<PolygonAggregate>, PolygonError>
pub async fn get_aggregates( &self, symbol: &str, multiplier: u32, timespan: &str, from: DateTime<Utc>, to: DateTime<Utc>, ) -> Result<Vec<PolygonAggregate>, PolygonError>
Get intraday aggregates with custom timespan
Sourcepub async fn get_snapshot_all(
&self,
) -> Result<Vec<PolygonTickerSnapshot>, PolygonError>
pub async fn get_snapshot_all( &self, ) -> Result<Vec<PolygonTickerSnapshot>, PolygonError>
Get snapshot of all tickers
Sourcepub async fn start_streaming(
&self,
symbols: Vec<String>,
) -> Result<(), PolygonError>
pub async fn start_streaming( &self, symbols: Vec<String>, ) -> Result<(), PolygonError>
Start WebSocket streaming for real-time data
Sourcepub async fn get_ticker_details(
&self,
symbol: &str,
) -> Result<PolygonTickerDetails, PolygonError>
pub async fn get_ticker_details( &self, symbol: &str, ) -> Result<PolygonTickerDetails, PolygonError>
Get ticker details
Auto Trait Implementations§
impl !Freeze for PolygonClient
impl !RefUnwindSafe for PolygonClient
impl Send for PolygonClient
impl Sync for PolygonClient
impl Unpin for PolygonClient
impl !UnwindSafe for PolygonClient
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