#[non_exhaustive]pub enum Provider {
Show 23 variants
Yahoo,
Polygon,
Fmp,
AlphaVantage,
CoinGecko,
Fred,
WorldBank,
FiscalData,
Bls,
Frankfurter,
Binance,
Kraken,
Finra,
DefiLlama,
Gdelt,
Cftc,
Nasdaq,
Wikipedia,
CongressTrades,
Edgar,
LocalMarketCalendar,
LocalExchange,
Custom(CustomId),
}Expand description
Typed identifier for a financial data provider.
Variants are feature-gated: unavailable providers are excluded at compile time.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Yahoo
Yahoo Finance (always available).
Polygon
Polygon.io (requires polygon feature).
Fmp
Financial Modeling Prep (requires fmp feature).
AlphaVantage
Alpha Vantage (requires alphavantage feature).
CoinGecko
CoinGecko cryptocurrency data (requires crypto feature).
Fred
FRED economic data (requires fred feature).
WorldBank
World Bank Open Data global macro indicators (requires worldbank feature, keyless).
FiscalData
US Treasury FiscalData (requires fiscaldata feature, keyless).
Bls
US Bureau of Labor Statistics (requires bls feature; keyless v1,
keyed v2 when BLS_API_KEY is set).
Frankfurter
Frankfurter ECB reference exchange rates (requires frankfurter feature, keyless).
Binance
Binance public market data (requires binance feature, keyless).
Kraken
Kraken public market data (requires kraken feature, keyless).
Finra
FINRA daily short-sale volume (requires finra feature, keyless).
DefiLlama
DefiLlama DeFi TVL data (requires defi feature, keyless).
Gdelt
GDELT DOC 2.0 global news search (requires gdelt feature, keyless).
Cftc
CFTC Commitments of Traders futures positioning (requires cftc
feature, keyless).
Nasdaq
Nasdaq market-wide earnings/IPO/dividend/split calendars (requires
nasdaq feature, keyless).
Wikipedia
Wikipedia S&P 500 index-constituent table (requires wikipedia
feature, keyless).
CongressTrades
Combined House + Senate PTR stock-trade disclosures (requires the
housetrades and/or senatetrades feature, keyless).
Edgar
SEC EDGAR filings (always available, keyless).
LocalMarketCalendar
NYSE/NASDAQ market holidays, computed locally from federal-holiday rules rather than fetched (always available, no network call).
LocalExchange
A static table of major global exchanges (always available, no network call).
Custom(CustomId)
A provider supplied by a downstream crate and registered with
ProvidersBuilder::with_adapter. Build one with
Provider::custom, which is the only way to obtain a CustomId.
Interning is per-process, so a custom id deserializes only after something in this process has constructed it.
The id is held as an index rather than a string so that Provider
stays small: it is stored in every model’s provider_id, and a fat
pointer here grows Candle by 22%.
Implementations§
Source§impl Provider
impl Provider
Sourcepub fn from_id_str(s: &str) -> Option<Self>
pub fn from_id_str(s: &str) -> Option<Self>
Parse a provider id string back to the typed variant.
Returns None if the string doesn’t match any known provider.
Prefer this over string conversion to avoid panics.
Sourcepub fn custom(id: &'static str) -> Self
pub fn custom(id: &'static str) -> Self
A provider this crate does not build, identified by id.
Interning is process-wide and append-only, so the same id always maps
to the same value and Provider::custom("x") == Provider::custom("x").
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
String identifier matching ProviderCore::id.
Sourcepub fn all() -> Vec<Self>
pub fn all() -> Vec<Self>
Every built-in provider variant compiled into this build, whether or not it is configured.
Custom providers are absent: they exist only once registered, and this
answers from the enum rather than from a live [crate::ProviderSet].
Returns a Vec rather than an iterator because the variants are
feature-gated and assembled at runtime.
Sourcepub fn capabilities(self) -> Capability
pub fn capabilities(self) -> Capability
Capability bitflags for this provider variant, derived from each
adapter’s as_* accessor overrides — implementing a capability trait
and declaring it can no longer drift apart. Yahoo is the one exception:
constructing YahooProvider needs a live auth handshake, so its set is
a const declared beside its accessor overrides (yahoo::CAPS).
Provider::Custom returns Capability::NONE. An id carries no
adapter, so a custom provider’s real set is
ProviderAdapter::capabilities
on the registered instance.
Trait Implementations§
impl Copy for Provider
Source§impl<'de> Deserialize<'de> for Provider
impl<'de> Deserialize<'de> for Provider
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Provider
impl StructuralPartialEq for Provider
Auto Trait Implementations§
impl Freeze for Provider
impl RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl UnsafeUnpin for Provider
impl UnwindSafe for Provider
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
impl<T> PlanCallbackArgs for T
impl<T> PlanCallbackOut for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more