pub struct CounterRpcProvider<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> { /* private fields */ }Expand description
A testing utility which implements a simple counter for tracking RPC method calls.
NOTE: not meant for production use
This provider is useful for testing and debugging purposes
Implementations§
Source§impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> CounterRpcProvider<T>
impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> CounterRpcProvider<T>
Sourcepub fn get_counter(&self, method: &RpcMethod) -> u64
pub fn get_counter(&self, method: &RpcMethod) -> u64
Get the counter for a given method
pub fn reset_counters(&self)
Source§impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> CounterRpcProvider<T>
impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> CounterRpcProvider<T>
Trait Implementations§
Source§impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> AsRef<RpcClient> for CounterRpcProvider<T>
impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> AsRef<RpcClient> for CounterRpcProvider<T>
Source§impl<T: Clone + TransactionRpcProvider + AsRef<RpcClient> + Clone> Clone for CounterRpcProvider<T>
impl<T: Clone + TransactionRpcProvider + AsRef<RpcClient> + Clone> Clone for CounterRpcProvider<T>
Source§fn clone(&self) -> CounterRpcProvider<T>
fn clone(&self) -> CounterRpcProvider<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> Display for CounterRpcProvider<T>
impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> Display for CounterRpcProvider<T>
Source§impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> From<T> for CounterRpcProvider<T>
impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> From<T> for CounterRpcProvider<T>
Source§impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> TransactionRpcProvider for CounterRpcProvider<T>
impl<T: TransactionRpcProvider + AsRef<RpcClient> + Clone> TransactionRpcProvider for CounterRpcProvider<T>
fn get_recent_prioritization_fees<'life0, 'life1, 'async_trait>(
&'life0 self,
accounts: &'life1 [Pubkey],
) -> Pin<Box<dyn Future<Output = Result<Vec<RpcPrioritizationFee>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_lookup_table_accounts<'life0, 'life1, 'async_trait>(
&'life0 self,
pubkeys: &'life1 [Pubkey],
) -> Pin<Box<dyn Future<Output = Result<Vec<AddressLookupTableAccount>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_latest_blockhash<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn simulate_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 VersionedTransaction,
config: RpcSimulateTransactionConfig,
) -> Pin<Box<dyn Future<Output = Result<RpcSimulateTransactionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_and_confirm_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 VersionedTransaction,
config: Option<RpcSendTransactionConfig>,
) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl<T> Freeze for CounterRpcProvider<T>where
T: Freeze,
impl<T> !RefUnwindSafe for CounterRpcProvider<T>
impl<T> Send for CounterRpcProvider<T>
impl<T> Sync for CounterRpcProvider<T>
impl<T> Unpin for CounterRpcProvider<T>where
T: Unpin,
impl<T> !UnwindSafe for CounterRpcProvider<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.