pub struct FinFeedDataLoader { /* private fields */ }Expand description
Fetches historical Nautilus data using retained outcome definitions.
Construction sends no requests and resolves credentials on the first network operation. Load or register definitions before requesting market data. Requests share one HTTP client, including its attempt allowance. Definition refreshes are explicit; each history request uses a snapshot of its registered definition and returns no partial result on failure.
Implementations§
Source§impl FinFeedDataLoader
impl FinFeedDataLoader
Sourcepub fn new(api_key: Option<SecretString>) -> Self
pub fn new(api_key: Option<SecretString>) -> Self
Creates a loader with an empty instrument registry and lazy HTTP transport.
Sourcepub fn with_http_config(
api_key: Option<SecretString>,
http_config: FinFeedHttpConfig,
) -> Self
pub fn with_http_config( api_key: Option<SecretString>, http_config: FinFeedHttpConfig, ) -> Self
Creates a loader with explicit HTTP controls, without resolving credentials or sending requests.
Sourcepub fn add_instrument(&self, instrument: BinaryOption) -> Result<()>
pub fn add_instrument(&self, instrument: BinaryOption) -> Result<()>
Registers an outcome definition, replacing the same ID after validation.
§Errors
Returns an error if the ID is not a FinFeed outcome or an outcome token has another owner.
Sourcepub fn instrument(&self, instrument_id: InstrumentId) -> Result<BinaryOption>
pub fn instrument(&self, instrument_id: InstrumentId) -> Result<BinaryOption>
Returns a retained definition.
§Errors
Returns an error if the definition has not been loaded or registered.
Sourcepub async fn request_instrument(
&self,
instrument_id: InstrumentId,
) -> Result<BinaryOption>
pub async fn request_instrument( &self, instrument_id: InstrumentId, ) -> Result<BinaryOption>
Fetches and retains a fresh outcome definition.
§Errors
Returns an error if retrieval, identity checks, or definition validation fails.
Sourcepub async fn request_instruments(
&self,
instruments: &[FinFeedInstrumentSelection],
) -> Result<Vec<BinaryOption>>
pub async fn request_instruments( &self, instruments: &[FinFeedInstrumentSelection], ) -> Result<Vec<BinaryOption>>
Fetches the supplied outcome selections and retains them atomically.
§Errors
Returns an error if selections, retrieval, or any definition fails validation. Failures preserve all previously registered definitions.
Sourcepub async fn request_book_deltas(
&self,
instrument_id: InstrumentId,
start: UnixNanos,
end: UnixNanos,
limit: Option<NonZeroUsize>,
) -> Result<Vec<OrderBookDelta>>
pub async fn request_book_deltas( &self, instrument_id: InstrumentId, start: UnixNanos, end: UnixNanos, limit: Option<NonZeroUsize>, ) -> Result<Vec<OrderBookDelta>>
Retrieves historical book deltas using the retained definition.
Bounds are inclusive on the adapter’s ordering clock. The local limit preserves complete book batches. A missing snapshot seed or ambiguous continuation rejects book history.
§Errors
Returns an error if metadata is missing, bounds are invalid, or retrieval or conversion fails.
Sourcepub async fn request_quotes(
&self,
instrument_id: InstrumentId,
start: UnixNanos,
end: UnixNanos,
limit: Option<NonZeroUsize>,
) -> Result<Vec<QuoteTick>>
pub async fn request_quotes( &self, instrument_id: InstrumentId, start: UnixNanos, end: UnixNanos, limit: Option<NonZeroUsize>, ) -> Result<Vec<QuoteTick>>
Retrieves historical quotes using the retained definition.
Bounds are inclusive on the adapter’s ordering clock.
§Errors
Returns an error if metadata is missing, bounds are invalid, or retrieval or conversion fails.
Sourcepub async fn request_trades(
&self,
instrument_id: InstrumentId,
start: UnixNanos,
end: UnixNanos,
limit: Option<NonZeroUsize>,
) -> Result<Vec<TradeTick>>
pub async fn request_trades( &self, instrument_id: InstrumentId, start: UnixNanos, end: UnixNanos, limit: Option<NonZeroUsize>, ) -> Result<Vec<TradeTick>>
Retrieves historical trades using the retained definition.
Bounds are inclusive on the adapter’s ordering clock.
§Errors
Returns an error if metadata is missing, bounds are invalid, or retrieval or conversion fails.
Sourcepub async fn request_bars(
&self,
bar_type: BarType,
start: UnixNanos,
end: UnixNanos,
limit: Option<NonZeroUsize>,
) -> Result<Vec<Bar>>
pub async fn request_bars( &self, bar_type: BarType, start: UnixNanos, end: UnixNanos, limit: Option<NonZeroUsize>, ) -> Result<Vec<Bar>>
Retrieves historical bars using the retained definition.
Bounds are inclusive on the adapter’s ordering clock.
§Errors
Returns an error if metadata is missing, bounds are invalid, or retrieval or conversion fails.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FinFeedDataLoader
impl !RefUnwindSafe for FinFeedDataLoader
impl !UnwindSafe for FinFeedDataLoader
impl Send for FinFeedDataLoader
impl Sync for FinFeedDataLoader
impl Unpin for FinFeedDataLoader
impl UnsafeUnpin for FinFeedDataLoader
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