pub struct Discovery { /* private fields */ }Expand description
Symbol discovery backed by configured data providers.
Unlike crate::finance::search — a Yahoo-only convenience shortcut —
this routes through Capability::DISCOVERY, so it honours the provider
priority configured on Providers::builder
and falls back across providers.
Created via Providers::discovery.
Implementations§
Source§impl Discovery
impl Discovery
Sourcepub fn cache(self, ttl: Duration) -> Self
pub fn cache(self, ttl: Duration) -> Self
Cache responses for ttl instead of the default 60 seconds,
deduplicating concurrent identical requests.
Sourcepub fn cache_forever(self) -> Self
pub fn cache_forever(self) -> Self
Cache responses for the handle’s lifetime instead of the default 60 seconds.
Source§impl Discovery
impl Discovery
Sourcepub async fn search(&self, query: &str, limit: u32) -> Result<Vec<SymbolMatch>>
pub async fn search(&self, query: &str, limit: u32) -> Result<Vec<SymbolMatch>>
Search the configured providers’ symbol universe.
Results are cached per (query, limit) pair.
Sourcepub async fn details(&self, symbol: &str) -> Result<SymbolDetails>
pub async fn details(&self, symbol: &str) -> Result<SymbolDetails>
Fetch detailed reference data for one symbol.
Sourcepub async fn exchanges(&self) -> Result<Vec<ExchangeInfo>>
pub async fn exchanges(&self) -> Result<Vec<ExchangeInfo>>
Fetch the tradable exchange listing.
Sourcepub async fn listing_status(&self, active: bool) -> Result<Vec<SymbolMatch>>
pub async fn listing_status(&self, active: bool) -> Result<Vec<SymbolMatch>>
Fetch the providers’ whole listed-security universe.
active = false asks for delisted securities instead. This is an
unfiltered dump — expect thousands of rows in one response — so prefer
search when you have a query. Cached per active.
EDGAR serves active = true keylessly from SEC’s bulk ticker files
(no exchange-listing history, so active = false isn’t supported
there); Alpha Vantage and FMP serve both.
Sourcepub async fn screener(
&self,
filters: &ScreenerFilters,
) -> Result<Vec<ScreenerMatch>>
pub async fn screener( &self, filters: &ScreenerFilters, ) -> Result<Vec<ScreenerMatch>>
Run a screener query over the providers’ universe.
Not cached — screener filters are open-ended and results are price-sensitive, so every call fetches fresh.
Auto Trait Implementations§
impl !Freeze for Discovery
impl !RefUnwindSafe for Discovery
impl !UnwindSafe for Discovery
impl Send for Discovery
impl Sync for Discovery
impl Unpin for Discovery
impl UnsafeUnpin for Discovery
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> 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 more