pub struct HttpRpcClient { /* private fields */ }Expand description
An HTTP RPC client for Monero.
Implementations§
Source§impl HttpRpcClient
impl HttpRpcClient
Sourcepub async fn new(address: Option<String>) -> Self
pub async fn new(address: Option<String>) -> Self
Create an HttpRpcClient.
address should be an HTTP URL pointing to a monerod.
If None is provided the default is used: LOCALHOST_RPC_URL.
Note that for Self::get_verified_block_information to work, the monerod
must be in unrestricted mode such that some fields (e.g. pow_hash) appear
in the JSON response.
§Panics
This panics if the address is invalid or a connection could not be made.
Sourcepub async fn get_verified_block_information(
&self,
height: usize,
) -> VerifiedBlockInformation
pub async fn get_verified_block_information( &self, height: usize, ) -> VerifiedBlockInformation
Request data and map the response to a VerifiedBlockInformation.
§Panics
This function will panic at any error point, e.g., if the node cannot be connected to, if deserialization fails, etc.
Sourcepub async fn get_transaction_verification_data<'a>(
&self,
tx_hashes: &'a [[u8; 32]],
) -> impl Iterator<Item = VerifiedTransactionInformation> + 'a
pub async fn get_transaction_verification_data<'a>( &self, tx_hashes: &'a [[u8; 32]], ) -> impl Iterator<Item = VerifiedTransactionInformation> + 'a
Request data and map the response to a VerifiedTransactionInformation.
§Panics
This function will panic at any error point, e.g., if the node cannot be connected to, if deserialization fails, etc.
Auto Trait Implementations§
impl !Freeze for HttpRpcClient
impl !RefUnwindSafe for HttpRpcClient
impl !UnwindSafe for HttpRpcClient
impl Send for HttpRpcClient
impl Sync for HttpRpcClient
impl Unpin for HttpRpcClient
impl UnsafeUnpin for HttpRpcClient
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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 376 bytes