Trait solana_accountsdb_plugin_interface::accountsdb_plugin_interface::AccountsDbPlugin [−][src]
pub trait AccountsDbPlugin: Any + Send + Sync + Debug {
fn name(&self) -> &'static str;
fn on_load(&mut self, _config_file: &str) -> Result<()> { ... }
fn on_unload(&mut self) { ... }
fn update_account(
&mut self,
account: ReplicaAccountInfoVersions<'_>,
slot: u64,
is_startup: bool
) -> Result<()> { ... }
fn notify_end_of_startup(&mut self) -> Result<()> { ... }
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus
) -> Result<()> { ... }
fn notify_transaction(
&mut self,
transaction: ReplicaTransactionInfoVersions<'_>,
slot: u64
) -> Result<()> { ... }
fn account_data_notifications_enabled(&self) -> bool { ... }
fn transaction_notifications_enabled(&self) -> bool { ... }
}
Required methods
Provided methods
The callback called when a plugin is loaded by the system, used for doing whatever initialization is required by the plugin. The _config_file contains the name of the of the config file. The config must be in JSON format and include a field “libpath” indicating the full path name of the shared library implementing this interface.
The callback called right before a plugin is unloaded by the system Used for doing cleanup before unload.
fn update_account(
&mut self,
account: ReplicaAccountInfoVersions<'_>,
slot: u64,
is_startup: bool
) -> Result<()>
fn update_account(
&mut self,
account: ReplicaAccountInfoVersions<'_>,
slot: u64,
is_startup: bool
) -> Result<()>
Called when an account is updated at a slot.
fn notify_end_of_startup(&mut self) -> Result<()>
fn notify_end_of_startup(&mut self) -> Result<()>
Called when all accounts are notified of during startup.
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus
) -> Result<()>
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus
) -> Result<()>
Called when a slot status is updated
fn notify_transaction(
&mut self,
transaction: ReplicaTransactionInfoVersions<'_>,
slot: u64
) -> Result<()>
fn notify_transaction(
&mut self,
transaction: ReplicaTransactionInfoVersions<'_>,
slot: u64
) -> Result<()>
Called when a transaction is updated at a slot.
fn account_data_notifications_enabled(&self) -> bool
fn account_data_notifications_enabled(&self) -> bool
Check if the plugin is interested in account data Default is true – if the plugin is not interested in account data, please return false.
fn transaction_notifications_enabled(&self) -> bool
fn transaction_notifications_enabled(&self) -> bool
Check if the plugin is interested in transaction data Default is false – if the plugin is not interested in transaction data, please return false.