Struct anchor_client::Program
source · pub struct Program<C> { /* private fields */ }Expand description
Program is the primary client handle to be used to build and send requests.
Implementations§
source§impl<C: Deref<Target = impl Signer> + Clone> Program<C>
impl<C: Deref<Target = impl Signer> + Clone> Program<C>
pub fn payer(&self) -> Pubkey
sourcepub fn request(&self) -> RequestBuilder<'_, C>
pub fn request(&self) -> RequestBuilder<'_, C>
Returns a request builder.
sourcepub fn account<T: AccountDeserialize>(
&self,
address: Pubkey
) -> Result<T, ClientError>
pub fn account<T: AccountDeserialize>( &self, address: Pubkey ) -> Result<T, ClientError>
Returns the account at the given address.
sourcepub fn accounts<T: AccountDeserialize + Discriminator>(
&self,
filters: Vec<RpcFilterType>
) -> Result<Vec<(Pubkey, T)>, ClientError>
pub fn accounts<T: AccountDeserialize + Discriminator>( &self, filters: Vec<RpcFilterType> ) -> Result<Vec<(Pubkey, T)>, ClientError>
Returns all program accounts of the given type matching the given filters
sourcepub fn accounts_lazy<T: AccountDeserialize + Discriminator>(
&self,
filters: Vec<RpcFilterType>
) -> Result<ProgramAccountsIterator<T>, ClientError>
pub fn accounts_lazy<T: AccountDeserialize + Discriminator>( &self, filters: Vec<RpcFilterType> ) -> Result<ProgramAccountsIterator<T>, ClientError>
Returns all program accounts of the given type matching the given filters as an iterator Deserialization is executed lazily