Skip to main content

FinFeedHttpClient

Struct FinFeedHttpClient 

Source
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

Source

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.

Source

pub fn cancel(&self)

Permanently cancels pending and future requests, including local admission and retry waits.

Construct a new client to make further requests.

Source

pub fn attempts_remaining(&self) -> u64

Returns the remaining local managed attempt allowance.

Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.

Source

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§

Source§

impl Debug for FinFeedHttpClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<T> Ungil for T
where T: Send,

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more