pub struct Program { /* private fields */ }Expand description
Program is the primary client handle to be used to build and send requests.
Implementations§
Source§impl Program
impl Program
pub fn payer(&self) -> Pubkey
Sourcepub fn request(&self) -> RequestBuilder<'_>
pub fn request(&self) -> RequestBuilder<'_>
Returns a request builder.
Sourcepub fn state_request(&self) -> RequestBuilder<'_>
pub fn state_request(&self) -> RequestBuilder<'_>
Returns a request builder for program state.
Sourcepub fn account<T>(&self, address: Pubkey) -> Result<T, ClientError>where
T: AccountDeserialize,
pub fn account<T>(&self, address: Pubkey) -> Result<T, ClientError>where
T: AccountDeserialize,
Returns the account at the given address.
Sourcepub fn accounts<T>(
&self,
filters: Vec<RpcFilterType>,
) -> Result<Vec<(Pubkey, T)>, ClientError>where
T: AccountDeserialize + Discriminator,
pub fn accounts<T>(
&self,
filters: Vec<RpcFilterType>,
) -> Result<Vec<(Pubkey, T)>, ClientError>where
T: AccountDeserialize + Discriminator,
Returns all program accounts of the given type matching the given filters
Sourcepub fn accounts_lazy<T>(
&self,
filters: Vec<RpcFilterType>,
) -> Result<ProgramAccountsIterator<T>, ClientError>where
T: AccountDeserialize + Discriminator,
pub fn accounts_lazy<T>(
&self,
filters: Vec<RpcFilterType>,
) -> Result<ProgramAccountsIterator<T>, ClientError>where
T: AccountDeserialize + Discriminator,
Returns all program accounts of the given type matching the given filters as an iterator Deserialization is executed lazily
pub fn state<T>(&self) -> Result<T, ClientError>where
T: AccountDeserialize,
pub fn rpc(&self) -> RpcClient
pub fn id(&self) -> Pubkey
pub fn on<T>(
&self,
f: impl Fn(&EventContext, T) + Send + 'static,
) -> Result<PubsubClientSubscription<Response<RpcLogsResponse>>, ClientError>where
T: Event + BorshDeserialize,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Program
impl !RefUnwindSafe for Program
impl !Send for Program
impl !Sync for Program
impl Unpin for Program
impl !UnwindSafe for Program
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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 more