MockConnector

Struct MockConnector 

Source
pub struct MockConnector;
Expand description

Mock connector for CI-safe examples. Provides deterministic data from static fixtures.

Implementations§

Source§

impl MockConnector

Source

pub const fn new() -> Self

Trait Implementations§

Source§

impl AnalystPriceTargetProvider for MockConnector

Source§

fn analyst_price_target<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<PriceTarget, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the current analyst price target for the given instrument.
Source§

impl BalanceSheetProvider for MockConnector

Source§

fn balance_sheet<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, _q: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<BalanceSheetRow>, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch balance sheet rows for the given instrument.
Source§

impl BorsaConnector for MockConnector

Source§

fn name(&self) -> &'static str

A stable identifier for priority lists (e.g., “borsa-yfinance”, “borsa-coinmarketcap”).
Source§

fn vendor(&self) -> &'static str

Human-friendly vendor string.
Source§

fn supports_kind(&self, _kind: AssetKind) -> bool

Whether this connector claims to support a given asset kind. Read more
Source§

fn as_quote_provider(&self) -> Option<&dyn QuoteProvider>

Advertise quote capability by returning a usable trait object reference when supported.
Source§

fn as_history_provider(&self) -> Option<&dyn HistoryProvider>

Advertise history capability by returning a usable trait object reference when supported.
Source§

fn as_search_provider(&self) -> Option<&dyn SearchProvider>

If implemented, returns a trait object for instrument search.
Source§

fn as_profile_provider(&self) -> Option<&dyn ProfileProvider>

If implemented, returns a trait object for company profiles.
Source§

fn as_earnings_provider(&self) -> Option<&dyn EarningsProvider>

If implemented, returns a trait object for earnings fundamentals.
Source§

fn as_income_statement_provider(&self) -> Option<&dyn IncomeStatementProvider>

If implemented, returns a trait object for income statements.
Source§

fn as_balance_sheet_provider(&self) -> Option<&dyn BalanceSheetProvider>

If implemented, returns a trait object for balance sheets.
Source§

fn as_cashflow_provider(&self) -> Option<&dyn CashflowProvider>

If implemented, returns a trait object for cashflow statements.
Source§

fn as_calendar_provider(&self) -> Option<&dyn CalendarProvider>

If implemented, returns a trait object for the fundamentals calendar.
Source§

fn as_options_expirations_provider( &self, ) -> Option<&dyn OptionsExpirationsProvider>

If implemented, returns a trait object for options expirations.
Source§

fn as_option_chain_provider(&self) -> Option<&dyn OptionChainProvider>

If implemented, returns a trait object for option chains.
Source§

fn as_recommendations_provider(&self) -> Option<&dyn RecommendationsProvider>

If implemented, returns a trait object for analyst recommendations.
Source§

fn as_recommendations_summary_provider( &self, ) -> Option<&dyn RecommendationsSummaryProvider>

If implemented, returns a trait object for recommendations summary.
Source§

fn as_upgrades_downgrades_provider( &self, ) -> Option<&dyn UpgradesDowngradesProvider>

If implemented, returns a trait object for upgrades/downgrades.
Source§

fn as_analyst_price_target_provider( &self, ) -> Option<&dyn AnalystPriceTargetProvider>

If implemented, returns a trait object for analyst price targets.
Source§

fn as_esg_provider(&self) -> Option<&dyn EsgProvider>

If implemented, returns a trait object for ESG scores.
Source§

fn as_news_provider(&self) -> Option<&dyn NewsProvider>

If implemented, returns a trait object for news articles.
Source§

fn key(&self) -> ConnectorKey

Canonical connector key constructed from the static name. Read more
Source§

fn as_major_holders_provider(&self) -> Option<&dyn MajorHoldersProvider>

If implemented, returns a trait object for major holders.
Source§

fn as_institutional_holders_provider( &self, ) -> Option<&dyn InstitutionalHoldersProvider>

If implemented, returns a trait object for institutional holders.
Source§

fn as_mutual_fund_holders_provider( &self, ) -> Option<&dyn MutualFundHoldersProvider>

If implemented, returns a trait object for mutual fund holders.
Source§

fn as_insider_transactions_provider( &self, ) -> Option<&dyn InsiderTransactionsProvider>

If implemented, returns a trait object for insider transactions.
Source§

fn as_insider_roster_holders_provider( &self, ) -> Option<&dyn InsiderRosterHoldersProvider>

If implemented, returns a trait object for insider roster holders.
Source§

fn as_net_share_purchase_activity_provider( &self, ) -> Option<&dyn NetSharePurchaseActivityProvider>

If implemented, returns a trait object for net share purchase activity.
Source§

fn as_isin_provider(&self) -> Option<&dyn IsinProvider>

If implemented, returns a trait object for ISIN lookup.
Source§

fn as_stream_provider(&self) -> Option<&dyn StreamProvider>

If implemented, returns a trait object for quote streaming.
Source§

impl CalendarProvider for MockConnector

Source§

fn calendar<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<Calendar, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the fundamentals calendar for the given instrument.
Source§

impl CashflowProvider for MockConnector

Source§

fn cashflow<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, _q: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<CashflowRow>, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch cashflow rows for the given instrument.
Source§

impl Default for MockConnector

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl EarningsProvider for MockConnector

Source§

fn earnings<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<Earnings, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch earnings for the given instrument.
Source§

impl EsgProvider for MockConnector

Source§

fn sustainability<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<EsgScores, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch ESG scores for the given instrument.
Source§

impl HistoryProvider for MockConnector

Source§

fn history<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, _req: HistoryRequest, ) -> Pin<Box<dyn Future<Output = Result<HistoryResponse, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch OHLCV history and actions for the given instrument and request.
Source§

fn supported_history_intervals(&self, _kind: AssetKind) -> &'static [Interval]

REQUIRED: exact intervals this connector can natively serve for history. Read more
Source§

impl IncomeStatementProvider for MockConnector

Source§

fn income_statement<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, _q: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<IncomeStatementRow>, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch income statement rows for the given instrument.
Source§

impl NewsProvider for MockConnector

Source§

fn news<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, req: NewsRequest, ) -> Pin<Box<dyn Future<Output = Result<Vec<NewsArticle>, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch news articles for the given instrument.
Source§

impl OptionChainProvider for MockConnector

Source§

fn option_chain<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, date: Option<i64>, ) -> Pin<Box<dyn Future<Output = Result<OptionChain, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch an option chain for the given instrument and optional expiration date.
Source§

impl OptionsExpirationsProvider for MockConnector

Source§

fn options_expirations<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<Vec<i64>, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a list of option expiration timestamps for the given instrument.
Source§

impl ProfileProvider for MockConnector

Source§

fn profile<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<Profile, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a profile for the given instrument.
Source§

impl QuoteProvider for MockConnector

Source§

fn quote<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<Quote, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a point-in-time quote for the given instrument.
Source§

impl RecommendationsProvider for MockConnector

Source§

fn recommendations<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<Vec<RecommendationRow>, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch recommendation rows for the given instrument.
Source§

impl RecommendationsSummaryProvider for MockConnector

Source§

fn recommendations_summary<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<RecommendationSummary, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a recommendations summary for the given instrument.
Source§

impl SearchProvider for MockConnector

Source§

fn search<'life0, 'async_trait>( &'life0 self, req: SearchRequest, ) -> Pin<Box<dyn Future<Output = Result<SearchResponse, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform a symbol search according to the provided request.
Source§

impl UpgradesDowngradesProvider for MockConnector

Source§

fn upgrades_downgrades<'life0, 'life1, 'async_trait>( &'life0 self, instrument: &'life1 Instrument, ) -> Pin<Box<dyn Future<Output = Result<Vec<UpgradeDowngradeRow>, BorsaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch upgrade/downgrade rows for the given instrument.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.