pub struct FinFeedInstrumentProvider { /* private fields */ }Expand description
Loads and retains provider-owned definitions for caller publication.
Startup loads replace the catalog only after every selection succeeds. Individual requests always fetch full metadata and replace only their requested definition after validation. Errors preserve the prior catalog. Returned definitions are the publication boundary; this provider does not own a message bus or a native adapter’s instrument definitions.
Implementations§
Source§impl FinFeedInstrumentProvider
impl FinFeedInstrumentProvider
Sourcepub fn new(http: Arc<FinFeedHttpClient>) -> Self
pub fn new(http: Arc<FinFeedHttpClient>) -> Self
Creates an empty provider sharing the caller’s REST client and request budget.
Sourcepub async fn load(
&mut self,
selections: &[FinFeedInstrumentSelection],
ts_init: UnixNanos,
) -> Result<Vec<BinaryOption>, Error>
pub async fn load( &mut self, selections: &[FinFeedInstrumentSelection], ts_init: UnixNanos, ) -> Result<Vec<BinaryOption>, Error>
Loads exactly the selected outcomes, in selection order, from fresh full metadata.
Callers can build selections using the REST client’s bounded listings or active IDs. A successful load replaces the retained catalog, including removing prior selections. Failures retain the prior catalog and return no definitions.
§Errors
Returns an error if:
- A selection is empty, duplicate, unknown, or unavailable.
- Metadata is incomplete, ambiguous, or inconsistent with the requested identity.
- Two provider IDs map to the same Polymarket outcome token.
- A REST request fails.
Sourcepub async fn request_instrument(
&mut self,
instrument_id: InstrumentId,
ts_init: UnixNanos,
) -> Result<BinaryOption, Error>
pub async fn request_instrument( &mut self, instrument_id: InstrumentId, ts_init: UnixNanos, ) -> Result<BinaryOption, Error>
Returns a newly fetched definition, updating only that instrument on success.
A valid FinFeed ID can be requested even when it was not part of startup selection. Failures retain the previous cache.
§Errors
Returns an error if:
- The ID, metadata, or mapping is invalid, unsupported, or unavailable.
- Another cached ID owns the same Polymarket outcome token.
- A REST request fails.
Trait Implementations§
Source§impl Clone for FinFeedInstrumentProvider
impl Clone for FinFeedInstrumentProvider
Auto Trait Implementations§
impl !RefUnwindSafe for FinFeedInstrumentProvider
impl !UnwindSafe for FinFeedInstrumentProvider
impl Freeze for FinFeedInstrumentProvider
impl Send for FinFeedInstrumentProvider
impl Sync for FinFeedInstrumentProvider
impl Unpin for FinFeedInstrumentProvider
impl UnsafeUnpin for FinFeedInstrumentProvider
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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