pub struct Hermes { /* private fields */ }Expand description
Hermes Client.
Implementations§
Source§impl Hermes
impl Hermes
Sourcepub fn try_new(base: impl IntoUrl) -> Result<Self>
pub fn try_new(base: impl IntoUrl) -> Result<Self>
Create a new hermes client with the given base URL.
Sourcepub async fn price_updates(
&self,
feed_ids: impl IntoIterator<Item = &Identifier>,
encoding: Option<EncodingType>,
) -> Result<impl Stream<Item = Result<PriceUpdate>> + 'static>
pub async fn price_updates( &self, feed_ids: impl IntoIterator<Item = &Identifier>, encoding: Option<EncodingType>, ) -> Result<impl Stream<Item = Result<PriceUpdate>> + 'static>
Get a stream of price updates.
Sourcepub async fn latest_price_updates(
&self,
feed_ids: impl IntoIterator<Item = &Identifier>,
encoding: Option<EncodingType>,
) -> Result<PriceUpdate>
pub async fn latest_price_updates( &self, feed_ids: impl IntoIterator<Item = &Identifier>, encoding: Option<EncodingType>, ) -> Result<PriceUpdate>
Get latest price updates.
Sourcepub async fn unit_prices_for_market(
&self,
token_map: &impl TokenMapAccess,
market: &impl HasMarketMeta,
) -> Result<Prices<u128>>
pub async fn unit_prices_for_market( &self, token_map: &impl TokenMapAccess, market: &impl HasMarketMeta, ) -> Result<Prices<u128>>
Get unit prices for the given market.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hermes
impl !RefUnwindSafe for Hermes
impl Send for Hermes
impl Sync for Hermes
impl Unpin for Hermes
impl !UnwindSafe for Hermes
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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 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>
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