pub struct SimpleBlockAccumulator<E> { /* private fields */ }Expand description
An in-memory store for blocks being reconstructed.
It maintains active blocks (currently being reconstructed) and frozen blocks (fully reconstructed).
Trait Implementations§
Source§impl<E> BlockAccumulator for SimpleBlockAccumulator<E>
impl<E> BlockAccumulator for SimpleBlockAccumulator<E>
Source§type EventT = E
type EventT = E
The type of events that this cumulator can handle. This is typically the same as the
EventT associated type of the GeyserEventAdapter used by the BlockStream.Source§type EventStore = SimpleBlockStore<E>
type EventStore = SimpleBlockStore<E>
The type of storage used to hold the events for a block. This is typically a
Vec<EventT>, but can be any type that can hold the events for a block.Source§fn add_event(&mut self, event: E, slot: Slot, ev_info: &GeyserEventInfo)
fn add_event(&mut self, event: E, slot: Slot, ev_info: &GeyserEventInfo)
Inserts a new event into the block accumulator for the given slot, under the given
Bucket.Source§fn freeze_block(&mut self, frozen_block_info: FrozenBlock)
fn freeze_block(&mut self, frozen_block_info: FrozenBlock)
Marks a block as frozen, indicating that it has been fully reconstructed and is ready for processing. Read more
Source§fn finish_block(&mut self, slot: Slot) -> Option<Block<SimpleBlockStore<E>>>
fn finish_block(&mut self, slot: Slot) -> Option<Block<SimpleBlockStore<E>>>
Finishes a block and returns it, if it exists. This is typically called when the block has been fully processed and is ready to be consumed. Read more
Source§fn prune_block(&mut self, slot: Slot)
fn prune_block(&mut self, slot: Slot)
Prunes a block from the accumulator, removing all associated events and data for the given slot.
This is typically called when a block is no longer needed, such as when it has been finalized or when a fork has been detected.
Auto Trait Implementations§
impl<E> Freeze for SimpleBlockAccumulator<E>
impl<E> RefUnwindSafe for SimpleBlockAccumulator<E>where
E: RefUnwindSafe,
impl<E> Send for SimpleBlockAccumulator<E>where
E: Send,
impl<E> Sync for SimpleBlockAccumulator<E>where
E: Sync,
impl<E> Unpin for SimpleBlockAccumulator<E>where
E: Unpin,
impl<E> UnsafeUnpin for SimpleBlockAccumulator<E>
impl<E> UnwindSafe for SimpleBlockAccumulator<E>where
E: UnwindSafe,
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