pub struct FinFeedHttpClient { /* private fields */ }Expand description
Authenticated read-only client returning provider models with exact decimal values.
Construction resolves credentials without sending requests. Callers share pacing, concurrency, retries, and a finite attempt allowance. Requests preserve provider response order and values without native instrument mapping or automatic historical continuation.
Implementations§
Source§impl FinFeedHttpClient
impl FinFeedHttpClient
Sourcepub fn new(
api_key: Option<SecretString>,
config: FinFeedHttpConfig,
) -> Result<Self, Error>
pub fn new( api_key: Option<SecretString>, config: FinFeedHttpConfig, ) -> Result<Self, Error>
Constructs transport and resolves credentials once.
§Errors
Returns an error if credentials, endpoint, proxy, or bounded controls are invalid, or transport construction fails.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Permanently cancels pending and future requests, including admission and retry waits.
Construct a new client to make further requests.
Sourcepub fn attempts_remaining(&self) -> u64
pub fn attempts_remaining(&self) -> u64
Returns the remaining local managed attempt allowance.
Sourcepub async fn get_exchanges(&self) -> Result<Vec<Exchange>, Error>
pub async fn get_exchanges(&self) -> Result<Vec<Exchange>, Error>
Retrieves supported exchanges.
§Errors
Returns an error if:
- Admission, transport, HTTP status, or response decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
Sourcepub async fn get_exchange(&self, exchange_id: &str) -> Result<Exchange, Error>
pub async fn get_exchange(&self, exchange_id: &str) -> Result<Exchange, Error>
Retrieves one exchange.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
Sourcepub async fn get_listings(
&self,
exchange_id: &str,
query: &ListingsQuery,
) -> Result<MarketsPage, Error>
pub async fn get_listings( &self, exchange_id: &str, query: &ListingsQuery, ) -> Result<MarketsPage, Error>
Retrieves one cursor listing page.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_active(
&self,
exchange_id: &str,
query: &ActiveQuery,
) -> Result<Vec<Ustr>, Error>
pub async fn get_active( &self, exchange_id: &str, query: &ActiveQuery, ) -> Result<Vec<Ustr>, Error>
Retrieves one page of active IDs; absence alone does not establish resolution.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_market(
&self,
exchange_id: &str,
market_id: &str,
) -> Result<Market, Error>
pub async fn get_market( &self, exchange_id: &str, market_id: &str, ) -> Result<Market, Error>
Retrieves an outcome definition without native instrument mapping.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
Sourcepub async fn get_current(
&self,
exchange_id: &str,
market_id: &str,
) -> Result<ActivityCurrent, Error>
pub async fn get_current( &self, exchange_id: &str, market_id: &str, ) -> Result<ActivityCurrent, Error>
Retrieves the latest trade and quote independently.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
Sourcepub async fn get_latest(
&self,
exchange_id: &str,
market_id: &str,
query: &ActivityQuery,
) -> Result<ActivityBatch, Error>
pub async fn get_latest( &self, exchange_id: &str, market_id: &str, query: &ActivityQuery, ) -> Result<ActivityBatch, Error>
Retrieves bounded activity with no continuation or continuity guarantee.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_trades_history(
&self,
exchange_id: &str,
market_id: &str,
query: &HistoryQuery,
) -> Result<Vec<Trade>, Error>
pub async fn get_trades_history( &self, exchange_id: &str, market_id: &str, query: &HistoryQuery, ) -> Result<Vec<Trade>, Error>
Retrieves one raw trade-history response without completeness or short-window guarantees.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_quotes_history(
&self,
exchange_id: &str,
market_id: &str,
query: &HistoryQuery,
) -> Result<Vec<Quote>, Error>
pub async fn get_quotes_history( &self, exchange_id: &str, market_id: &str, query: &HistoryQuery, ) -> Result<Vec<Quote>, Error>
Retrieves one raw quote-history response without completeness or short-window guarantees.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_book(
&self,
exchange_id: &str,
market_id: &str,
) -> Result<Book, Error>
pub async fn get_book( &self, exchange_id: &str, market_id: &str, ) -> Result<Book, Error>
Retrieves a current book snapshot.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
Sourcepub async fn get_book_history(
&self,
exchange_id: &str,
market_id: &str,
query: &HistoryQuery,
) -> Result<Vec<BookEvent>, Error>
pub async fn get_book_history( &self, exchange_id: &str, market_id: &str, query: &HistoryQuery, ) -> Result<Vec<BookEvent>, Error>
Retrieves one bounded array of raw historical book events in response order.
Date/time selectors use provider processing time, which may be absent from the events. Numeric actions remain uninterpreted. A saturated response may be truncated; a short or empty response does not establish coverage. No snapshot or continuation is inferred.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_periods(&self) -> Result<Vec<OhlcvPeriod>, Error>
pub async fn get_periods(&self) -> Result<Vec<OhlcvPeriod>, Error>
Retrieves supported OHLCV periods.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
Sourcepub async fn get_ohlcv_history(
&self,
exchange_id: &str,
market_id: &str,
query: &OhlcvQuery,
) -> Result<Vec<Ohlcv>, Error>
pub async fn get_ohlcv_history( &self, exchange_id: &str, market_id: &str, query: &OhlcvQuery, ) -> Result<Vec<Ohlcv>, Error>
Retrieves one historical market OHLCV response without completeness or short-window guarantees.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_ohlcv_flat_file_history(
&self,
exchange_id: &str,
market_id: &str,
query: &FlatFileOhlcvQuery,
) -> Result<Vec<Ohlcv>, Error>
pub async fn get_ohlcv_flat_file_history( &self, exchange_id: &str, market_id: &str, query: &FlatFileOhlcvQuery, ) -> Result<Vec<Ohlcv>, Error>
Retrieves OHLCV from the provider’s flat-file activity source.
The provider describes this source as trade-generated. Returns one response without filtering, pagination, or fallback to DB-backed OHLCV. A saturated response may be truncated; no continuation or bound inclusion is inferred. Short or empty responses do not establish source coverage or completeness.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_ohlcv_exchange_history(
&self,
exchange_id: &str,
query: &OhlcvQuery,
) -> Result<Vec<Ohlcv>, Error>
pub async fn get_ohlcv_exchange_history( &self, exchange_id: &str, query: &OhlcvQuery, ) -> Result<Vec<Ohlcv>, Error>
Retrieves one exchange-wide OHLCV response with market identifiers retained.
Both time bounds are required, at most 24 hours apart, with a limit in [1, 10000].
Returns every response row in provider order, without time filtering or native mapping.
Callers partition longer windows explicitly; saturation may truncate markets at the
same timestamp, so advancing by the last timestamp cannot establish completeness.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested row limit.
Sourcepub async fn get_ohlcv_latest(
&self,
exchange_id: &str,
market_id: &str,
query: &OhlcvQuery,
) -> Result<Vec<Ohlcv>, Error>
pub async fn get_ohlcv_latest( &self, exchange_id: &str, market_id: &str, query: &OhlcvQuery, ) -> Result<Vec<Ohlcv>, Error>
Retrieves the newest market OHLCV bars without time bounds.
§Errors
Returns an error if:
- Request validation, transport, HTTP status, or decoding fails.
- The local allowance is exhausted, a deadline expires, or the request is canceled.
- A response exceeds the requested record limit.
Sourcepub async fn get_listings_all(
&self,
exchange_id: &str,
query: &ListingsQuery,
bounds: Pagination,
) -> Result<Vec<Market>, Error>
pub async fn get_listings_all( &self, exchange_id: &str, query: &ListingsQuery, bounds: Pagination, ) -> Result<Vec<Market>, Error>
Collects listings until a null or omitted cursor, rejecting cycles and exceeded traversal bounds.
§Errors
Returns an error if a page fails, a cursor is empty or repeats, or a pagination bound is exceeded.
Sourcepub async fn get_active_all(
&self,
exchange_id: &str,
query: &ActiveQuery,
bounds: Pagination,
) -> Result<Vec<Ustr>, Error>
pub async fn get_active_all( &self, exchange_id: &str, query: &ActiveQuery, bounds: Pagination, ) -> Result<Vec<Ustr>, Error>
Collects active IDs until an empty page, rejecting duplicate IDs and exceeded bounds.
A short page alone does not establish exhaustion. Results are observations of a changing catalog, not a consistent snapshot.
§Errors
Returns an error if a page fails, an ID is empty or repeats, or a pagination bound is exceeded.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FinFeedHttpClient
impl !RefUnwindSafe for FinFeedHttpClient
impl !UnwindSafe for FinFeedHttpClient
impl Send for FinFeedHttpClient
impl Sync for FinFeedHttpClient
impl Unpin for FinFeedHttpClient
impl UnsafeUnpin for FinFeedHttpClient
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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