use solana_clock::Slot;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SlotStatusKind {
FirstShredReceived,
Completed,
CreatedBank,
Dead,
Processed,
Confirmed,
Finalized,
Other,
}
#[derive(Debug, Clone, Copy)]
pub struct SlotUpdateView {
pub slot: Slot,
pub parent: Option<Slot>,
pub status: SlotStatusKind,
pub dead_error: bool,
}
#[derive(Debug, Clone, Copy)]
pub struct BlockMetaView<'a> {
pub slot: Slot,
pub parent_slot: Slot,
pub entries_count: u64,
pub executed_transaction_count: u64,
pub blockhash: &'a str,
}
#[derive(Debug, Clone, Copy)]
pub struct EntryView<'a> {
pub slot: Slot,
pub index: u64,
pub starting_transaction_index: u64,
pub executed_transaction_count: u64,
pub hash: &'a [u8],
pub filters: &'a [String],
}
#[derive(Debug, Clone, Copy)]
pub enum GeyserEventView<'a> {
Slot(SlotUpdateView),
BlockMeta(BlockMetaView<'a>),
Entry(EntryView<'a>),
Transaction { slot: Slot },
Account { slot: Slot },
TransactionStatus { slot: Slot },
Other,
}
pub trait GeyserEventViewer {
type GeyserEventT;
fn view(event: &Self::GeyserEventT) -> GeyserEventView<'_>;
}