Function switchboard_solana::prelude::fetch_zerocopy_account_sync
source · pub fn fetch_zerocopy_account_sync<C: SyncClient, T: Pod + Discriminator + Owner>(
client: &C,
pubkey: Pubkey
) -> Result<T, SbError>Expand description
Fetches the account data synchronously from the Solana blockchain using the provided client.
§Arguments
client- The client used to interact with the Solana blockchain.pubkey- The public key of the account to fetch.
§Generic Parameters
C- The type of the client, which must implement theSyncClienttrait.T- The type of the account data, which must implement thebytemuck::Pod,Discriminator, andOwnertraits.
§Returns
Returns a Result containing the fetched account data of type T if successful, or an SbError if an error occurs.