pub struct BlockchainShadow { /* private fields */ }
Expand description
The entry point to the Solana Blockchain Shadow API
This type allows its users to monitor several individual
accounts or all accounts of a program, or a combination
of both for any changes to those accounts and have the
most recent version of those accounts available locally
and accessible as if they were stored in a local
hashmap<Pubkey, Account>
Implementations§
Source§impl BlockchainShadow
impl BlockchainShadow
pub async fn new(options: SyncOptions) -> Result<Self>
pub async fn add_accounts( &mut self, accounts: &[Pubkey], ) -> Result<Vec<Option<Account>>>
pub async fn add_account(&mut self, account: &Pubkey) -> Result<Option<Account>>
pub async fn add_program(&mut self, program_id: &Pubkey) -> Result<Vec<Account>>
pub async fn new_for_accounts( accounts: &[Pubkey], options: SyncOptions, ) -> Result<Self>
pub async fn new_for_program( program: &Pubkey, options: SyncOptions, ) -> Result<Self>
pub const fn network(&self) -> &Network
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn for_each_account(&self, op: impl FnMut(&Pubkey, &Account))
pub fn get_account(&self, key: &Pubkey) -> Option<Account>
pub async fn worker(self) -> Result<()>
pub fn updates_channel(&self) -> Receiver<(Pubkey, Account)>
Auto Trait Implementations§
impl Freeze for BlockchainShadow
impl !RefUnwindSafe for BlockchainShadow
impl Send for BlockchainShadow
impl Sync for BlockchainShadow
impl Unpin for BlockchainShadow
impl !UnwindSafe for BlockchainShadow
Blanket Implementations§
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