pub struct MarketDataProvider { /* private fields */ }Expand description
Market data provider
Implementations§
Source§impl MarketDataProvider
impl MarketDataProvider
pub fn into_reference( val: MarketDataProvider, env: Env, ) -> Result<Reference<MarketDataProvider>>
pub fn into_instance( self, env: Env, ) -> Result<ClassInstance<MarketDataProvider>>
Source§impl MarketDataProvider
impl MarketDataProvider
Sourcepub fn new(config: MarketDataConfig) -> Self
pub fn new(config: MarketDataConfig) -> Self
Create a new market data provider
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect from provider
Sourcepub async fn fetch_bars(
&self,
symbol: String,
start: String,
end: String,
timeframe: String,
) -> Result<Vec<Bar>>
pub async fn fetch_bars( &self, symbol: String, start: String, end: String, timeframe: String, ) -> Result<Vec<Bar>>
Fetch historical bars
Sourcepub fn subscribe_quotes(
&self,
symbols: Vec<String>,
callback: JsFunction,
) -> Result<SubscriptionHandle>
pub fn subscribe_quotes( &self, symbols: Vec<String>, callback: JsFunction, ) -> Result<SubscriptionHandle>
Subscribe to real-time quotes
Sourcepub async fn get_quotes_batch(&self, symbols: Vec<String>) -> Result<Vec<Quote>>
pub async fn get_quotes_batch(&self, symbols: Vec<String>) -> Result<Vec<Quote>>
Get multiple quotes at once
Sourcepub async fn is_connected(&self) -> Result<bool>
pub async fn is_connected(&self) -> Result<bool>
Check if provider is connected
Trait Implementations§
Source§impl FromNapiMutRef for MarketDataProvider
impl FromNapiMutRef for MarketDataProvider
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for MarketDataProvider
impl FromNapiRef for MarketDataProvider
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &MarketDataProvider
impl FromNapiValue for &MarketDataProvider
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut MarketDataProvider
impl FromNapiValue for &mut MarketDataProvider
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ObjectFinalize for MarketDataProvider
impl ObjectFinalize for MarketDataProvider
Source§impl ToNapiValue for MarketDataProvider
impl ToNapiValue for MarketDataProvider
Source§unsafe fn to_napi_value(
env: napi_env,
val: MarketDataProvider,
) -> Result<napi_value>
unsafe fn to_napi_value( env: napi_env, val: MarketDataProvider, ) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &MarketDataProvider
impl TypeName for &MarketDataProvider
Source§impl TypeName for &mut MarketDataProvider
impl TypeName for &mut MarketDataProvider
Source§impl TypeName for MarketDataProvider
impl TypeName for MarketDataProvider
Source§impl ValidateNapiValue for &MarketDataProvider
impl ValidateNapiValue for &MarketDataProvider
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut MarketDataProvider
impl ValidateNapiValue for &mut MarketDataProvider
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for MarketDataProvider
impl !RefUnwindSafe for MarketDataProvider
impl Send for MarketDataProvider
impl Sync for MarketDataProvider
impl Unpin for MarketDataProvider
impl !UnwindSafe for MarketDataProvider
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