pub struct NdjsonPlugin { /* private fields */ }Expand description
Built-in plugin that writes structured data to NDJSON files.
Creates one file per record type in the specified directory:
blocks.ndjson, transactions.ndjson, token_transfers.ndjson, account_activity.ndjson.
Files are append-only and safe for resume (re-runs append duplicates).
Implementations§
Trait Implementations§
Source§impl Plugin for NdjsonPlugin
impl Plugin for NdjsonPlugin
Source§fn on_load<'a>(&'a self) -> PluginFuture<'a>
fn on_load<'a>(&'a self) -> PluginFuture<'a>
Called once when the runner starts, before any data is fetched.
Use this to create tables, open connections, or validate config.
Source§fn on_block<'a>(&'a self, block: &'a BlockData) -> PluginFuture<'a>
fn on_block<'a>(&'a self, block: &'a BlockData) -> PluginFuture<'a>
Called for each block. Fired once per slot, before transactions.
Source§fn on_transaction<'a>(&'a self, tx: &'a TransactionData) -> PluginFuture<'a>
fn on_transaction<'a>(&'a self, tx: &'a TransactionData) -> PluginFuture<'a>
Called for each transaction within a block.
Fired in order of
tx_index within the slot.Source§fn on_token_transfer<'a>(
&'a self,
transfer: &'a TokenTransferData,
) -> PluginFuture<'a>
fn on_token_transfer<'a>( &'a self, transfer: &'a TokenTransferData, ) -> PluginFuture<'a>
Called for each token balance change within a transaction.
Only fired when the balance actually changed (pre != post).
Source§fn on_account_activity<'a>(
&'a self,
activity: &'a AccountActivityData,
) -> PluginFuture<'a>
fn on_account_activity<'a>( &'a self, activity: &'a AccountActivityData, ) -> PluginFuture<'a>
Called for each account touched by a transaction (SOL balance changes).
Source§fn on_exit<'a>(&'a self) -> PluginFuture<'a>
fn on_exit<'a>(&'a self) -> PluginFuture<'a>
Called once when the runner is shutting down. Flush buffers, close connections.
Source§fn on_raw<'a>(&'a self, _slot: u64, _raw: &'a Value) -> PluginFuture<'a>
fn on_raw<'a>(&'a self, _slot: u64, _raw: &'a Value) -> PluginFuture<'a>
Called for every non-skipped slot with the full raw JSON-RPC response. Read more
Source§fn on_skipped_slot<'a>(&'a self, _slot: u64) -> PluginFuture<'a>
fn on_skipped_slot<'a>(&'a self, _slot: u64) -> PluginFuture<'a>
Called when a slot was skipped by the Solana leader (no block produced).
Auto Trait Implementations§
impl !Freeze for NdjsonPlugin
impl RefUnwindSafe for NdjsonPlugin
impl Send for NdjsonPlugin
impl Sync for NdjsonPlugin
impl Unpin for NdjsonPlugin
impl UnsafeUnpin for NdjsonPlugin
impl UnwindSafe for NdjsonPlugin
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