pub trait Rpc:
    Send
    + Sync
    + Debug
    + 'static {
Show 32 methods
    // Required methods
    fn new<'async_trait>(
        config: LightClientConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Self, RpcError>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
    fn get_payer(&self) -> &Keypair;
    fn get_url(&self) -> String;
    fn health<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_program_accounts<'life0, 'life1, 'async_trait>(
        &'life0 self,
        program_id: &'life1 Pubkey,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(Pubkey, Account)>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn confirm_transaction<'life0, 'async_trait>(
        &'life0 self,
        signature: Signature,
    ) -> Pin<Box<dyn Future<Output = Result<bool, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_account<'life0, 'async_trait>(
        &'life0 self,
        address: Pubkey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Account>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_minimum_balance_for_rent_exemption<'life0, 'async_trait>(
        &'life0 self,
        data_len: usize,
    ) -> Pin<Box<dyn Future<Output = Result<u64, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn airdrop_lamports<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        to: &'life1 Pubkey,
        lamports: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_balance<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pubkey: &'life1 Pubkey,
    ) -> Pin<Box<dyn Future<Output = Result<u64, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_latest_blockhash<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(Hash, u64), RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_slot<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transaction_slot<'life0, 'life1, 'async_trait>(
        &'life0 self,
        signature: &'life1 Signature,
    ) -> Pin<Box<dyn Future<Output = Result<u64, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_signature_statuses<'life0, 'life1, 'async_trait>(
        &'life0 self,
        signatures: &'life1 [Signature],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<TransactionStatus>>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn send_transaction<'life0, 'life1, 'async_trait>(
        &'life0 self,
        transaction: &'life1 Transaction,
    ) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn send_transaction_with_config<'life0, 'life1, 'async_trait>(
        &'life0 self,
        transaction: &'life1 Transaction,
        config: RpcSendTransactionConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn process_transaction<'life0, 'async_trait>(
        &'life0 mut self,
        transaction: Transaction,
    ) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn process_transaction_with_context<'life0, 'async_trait>(
        &'life0 mut self,
        transaction: Transaction,
    ) -> Pin<Box<dyn Future<Output = Result<(Signature, Slot), RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_and_send_transaction_with_event<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, T>(
        &'life0 mut self,
        instructions: &'life1 [Instruction],
        authority: &'life2 Pubkey,
        signers: &'life3 [&'life4 Keypair],
    ) -> Pin<Box<dyn Future<Output = Result<Option<(T, Signature, Slot)>, RpcError>> + Send + 'async_trait>>
       where T: BorshDeserialize + Send + Debug + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn create_and_send_transaction_with_public_event<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 mut self,
        instruction: &'life1 [Instruction],
        payer: &'life2 Pubkey,
        signers: &'life3 [&'life4 Keypair],
    ) -> Pin<Box<dyn Future<Output = Result<Option<(PublicTransactionEvent, Signature, Slot)>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn create_and_send_transaction_with_batched_event<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 mut self,
        instruction: &'life1 [Instruction],
        payer: &'life2 Pubkey,
        signers: &'life3 [&'life4 Keypair],
    ) -> Pin<Box<dyn Future<Output = Result<Option<(Vec<BatchPublicTransactionEvent>, Signature, Slot)>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn indexer(&self) -> Result<&impl Indexer, RpcError>;
    fn indexer_mut(&mut self) -> Result<&mut impl Indexer, RpcError>;
    fn get_latest_active_state_trees<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TreeInfo>, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_state_tree_infos(&self) -> Vec<TreeInfo>;
    fn get_random_state_tree_info(&self) -> Result<TreeInfo, RpcError>;
    fn get_random_state_tree_info_v1(&self) -> Result<TreeInfo, RpcError>;
    fn get_address_tree_v1(&self) -> TreeInfo;
    fn get_address_tree_v2(&self) -> TreeInfo;
    // Provided methods
    fn should_retry(&self, error: &RpcError) -> bool { ... }
    fn get_anchor_account<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        pubkey: &'life1 Pubkey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<T>, RpcError>> + Send + 'async_trait>>
       where T: 'async_trait + BorshDeserialize,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn create_and_send_transaction<'a, 'async_trait>(
        &'a mut self,
        instructions: &'a [Instruction],
        payer: &'a Pubkey,
        signers: &'a [&'a Keypair],
    ) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait { ... }
}Required Methods§
fn new<'async_trait>(
    config: LightClientConfig,
) -> Pin<Box<dyn Future<Output = Result<Self, RpcError>> + Send + 'async_trait>>where
    Self: Sized + 'async_trait,
fn get_payer(&self) -> &Keypair
fn get_url(&self) -> String
fn health<'life0, 'async_trait>(
    &'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
fn get_program_accounts<'life0, 'life1, 'async_trait>(
    &'life0 self,
    program_id: &'life1 Pubkey,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Pubkey, Account)>, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
fn confirm_transaction<'life0, 'async_trait>(
    &'life0 self,
    signature: Signature,
) -> Pin<Box<dyn Future<Output = Result<bool, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Sourcefn get_account<'life0, 'async_trait>(
    &'life0 self,
    address: Pubkey,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_account<'life0, 'async_trait>(
    &'life0 self,
    address: Pubkey,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Returns an account struct.
fn get_minimum_balance_for_rent_exemption<'life0, 'async_trait>(
    &'life0 self,
    data_len: usize,
) -> Pin<Box<dyn Future<Output = Result<u64, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
fn airdrop_lamports<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    to: &'life1 Pubkey,
    lamports: u64,
) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
fn get_balance<'life0, 'life1, 'async_trait>(
    &'life0 self,
    pubkey: &'life1 Pubkey,
) -> Pin<Box<dyn Future<Output = Result<u64, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
fn get_latest_blockhash<'life0, 'async_trait>(
    &'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(Hash, u64), RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
fn get_slot<'life0, 'async_trait>(
    &'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
fn get_transaction_slot<'life0, 'life1, 'async_trait>(
    &'life0 self,
    signature: &'life1 Signature,
) -> Pin<Box<dyn Future<Output = Result<u64, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
fn get_signature_statuses<'life0, 'life1, 'async_trait>(
    &'life0 self,
    signatures: &'life1 [Signature],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<TransactionStatus>>, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
fn send_transaction<'life0, 'life1, 'async_trait>(
    &'life0 self,
    transaction: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
fn send_transaction_with_config<'life0, 'life1, 'async_trait>(
    &'life0 self,
    transaction: &'life1 Transaction,
    config: RpcSendTransactionConfig,
) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
fn process_transaction<'life0, 'async_trait>(
    &'life0 mut self,
    transaction: Transaction,
) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
fn process_transaction_with_context<'life0, 'async_trait>(
    &'life0 mut self,
    transaction: Transaction,
) -> Pin<Box<dyn Future<Output = Result<(Signature, Slot), RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
fn create_and_send_transaction_with_event<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, T>(
    &'life0 mut self,
    instructions: &'life1 [Instruction],
    authority: &'life2 Pubkey,
    signers: &'life3 [&'life4 Keypair],
) -> Pin<Box<dyn Future<Output = Result<Option<(T, Signature, Slot)>, RpcError>> + Send + 'async_trait>>where
    T: BorshDeserialize + Send + Debug + 'async_trait,
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait,
fn create_and_send_transaction_with_public_event<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
    &'life0 mut self,
    instruction: &'life1 [Instruction],
    payer: &'life2 Pubkey,
    signers: &'life3 [&'life4 Keypair],
) -> Pin<Box<dyn Future<Output = Result<Option<(PublicTransactionEvent, Signature, Slot)>, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait,
fn create_and_send_transaction_with_batched_event<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
    &'life0 mut self,
    instruction: &'life1 [Instruction],
    payer: &'life2 Pubkey,
    signers: &'life3 [&'life4 Keypair],
) -> Pin<Box<dyn Future<Output = Result<Option<(Vec<BatchPublicTransactionEvent>, Signature, Slot)>, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    'life4: 'async_trait,
fn indexer(&self) -> Result<&impl Indexer, RpcError>
fn indexer_mut(&mut self) -> Result<&mut impl Indexer, RpcError>
Sourcefn get_latest_active_state_trees<'life0, 'async_trait>(
    &'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TreeInfo>, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn get_latest_active_state_trees<'life0, 'async_trait>(
    &'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TreeInfo>, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Fetch the latest state tree addresses from the cluster.
Sourcefn get_state_tree_infos(&self) -> Vec<TreeInfo>
 
fn get_state_tree_infos(&self) -> Vec<TreeInfo>
Gets state tree infos. State trees are cached and have to be fetched or set.
Sourcefn get_random_state_tree_info(&self) -> Result<TreeInfo, RpcError>
 
fn get_random_state_tree_info(&self) -> Result<TreeInfo, RpcError>
Gets a random state tree info. State trees are cached and have to be fetched or set. Returns v1 state trees by default, v2 state trees when v2 feature is enabled.
Sourcefn get_random_state_tree_info_v1(&self) -> Result<TreeInfo, RpcError>
 
fn get_random_state_tree_info_v1(&self) -> Result<TreeInfo, RpcError>
Gets a random v1 state tree info. State trees are cached and have to be fetched or set.
fn get_address_tree_v1(&self) -> TreeInfo
fn get_address_tree_v2(&self) -> TreeInfo
Provided Methods§
fn should_retry(&self, error: &RpcError) -> bool
Sourcefn get_anchor_account<'life0, 'life1, 'async_trait, T>(
    &'life0 self,
    pubkey: &'life1 Pubkey,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, RpcError>> + Send + 'async_trait>>where
    T: 'async_trait + BorshDeserialize,
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn get_anchor_account<'life0, 'life1, 'async_trait, T>(
    &'life0 self,
    pubkey: &'life1 Pubkey,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, RpcError>> + Send + 'async_trait>>where
    T: 'async_trait + BorshDeserialize,
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Returns an a borsh deserialized account. Deserialization skips the discriminator.
fn create_and_send_transaction<'a, 'async_trait>(
    &'a mut self,
    instructions: &'a [Instruction],
    payer: &'a Pubkey,
    signers: &'a [&'a Keypair],
) -> Pin<Box<dyn Future<Output = Result<Signature, RpcError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'a: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.