pub struct PythHermesClient { /* private fields */ }Implementations§
Source§impl PythHermesClient
impl PythHermesClient
Sourcepub fn new(
base_url: impl Into<String>,
egress_contract: HttpEgressContract,
) -> Result<Self, PriceOracleError>
pub fn new( base_url: impl Into<String>, egress_contract: HttpEgressContract, ) -> Result<Self, PriceOracleError>
Construct a PythHermesClient bound to a typed
HttpEgressContract. The contract is required: every Hermes
dispatch routes through send_with_contract so the URL, every
redirect target, and the response body size are validated before
bytes leave the substrate.
Sourcepub fn with_contract(
base_url: impl Into<String>,
egress_contract: HttpEgressContract,
) -> Result<Self, PriceOracleError>
pub fn with_contract( base_url: impl Into<String>, egress_contract: HttpEgressContract, ) -> Result<Self, PriceOracleError>
Alias for PythHermesClient::new. The contract is required on
production paths; tests that need a permissive contract should use
HttpEgressContract::permissive_for_tests.
Trait Implementations§
Source§impl Debug for PythHermesClient
impl Debug for PythHermesClient
Source§impl OracleBackend for PythHermesClient
impl OracleBackend for PythHermesClient
fn kind(&self) -> OracleBackendKind
fn read_rate<'a>(&'a self, pair: &'a PairConfig, now: u64) -> OracleFuture<'a>
Auto Trait Implementations§
impl !RefUnwindSafe for PythHermesClient
impl !UnwindSafe for PythHermesClient
impl Freeze for PythHermesClient
impl Send for PythHermesClient
impl Sync for PythHermesClient
impl Unpin for PythHermesClient
impl UnsafeUnpin for PythHermesClient
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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