pub struct Client { /* private fields */ }Expand description
The library client. Holds configuration, the HTTP requester and the cache.
Implementations§
Source§impl Client
impl Client
pub fn new() -> Result<Self>
pub fn with_parts(config: Config, storage: Storage) -> Self
pub fn config(&self) -> &Config
pub fn config_mut(&mut self) -> &mut Config
pub fn storage(&self) -> &Storage
Sourcepub async fn update_instruments(&self) -> Result<Option<ResultError>>
pub async fn update_instruments(&self) -> Result<Option<ResultError>>
Port of JS updateInstruments. Returns an optional domain error.
Sourcepub async fn get_prices(
&self,
symbols: &[String],
settings: &PriceSettings,
) -> Result<PricesResult>
pub async fn get_prices( &self, symbols: &[String], settings: &PriceSettings, ) -> Result<PricesResult>
Port of JS getPrices.
Source§impl Client
impl Client
Sourcepub async fn get_intraday(
&self,
symbols: &[String],
settings: &IntradaySettings,
) -> Result<IntradayResult>
pub async fn get_intraday( &self, symbols: &[String], settings: &IntradaySettings, ) -> Result<IntradayResult>
Port of JS getIntraday.
Source§impl Client
impl Client
Sourcepub async fn get_instruments(&self) -> Result<HashMap<String, Instrument>>
pub async fn get_instruments(&self) -> Result<HashMap<String, Instrument>>
Port of JS getInstruments. Returns instruments keyed by InsCode.
Sourcepub async fn get_intraday_instruments(
&self,
) -> Result<HashMap<String, InstrumentItd>>
pub async fn get_intraday_instruments( &self, ) -> Result<HashMap<String, InstrumentItd>>
Port of JS getIntradayInstruments. Returns intraday instruments keyed
by InsCode.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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