Struct anchor_client::Program
source · [−]pub struct Program { /* private fields */ }
Expand description
Program is the primary client handle to be used to build and send requests.
Implementations
sourceimpl 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: 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
pub fn state<T: AccountDeserialize>(&self) -> Result<T, ClientError>
pub fn rpc(&self) -> RpcClient
pub fn id(&self) -> Pubkey
pub fn on<T: Event + AnchorDeserialize>(
&self,
f: impl Fn(&EventContext, T) + Send + 'static
) -> Result<EventHandle, ClientError>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Program
impl !Send for Program
impl !Sync for Program
impl Unpin for Program
impl !UnwindSafe for Program
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
pub default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more