pub struct SnapshotEngine { /* private fields */ }Expand description
Snapshot Engine - Builds memory snapshots from event data
The SnapshotEngine is responsible for constructing point-in-time views of memory usage from the events stored in the EventStore.
Key properties:
- Read-only: Does not consume events from EventStore
- Efficient: Optimized for fast snapshot construction
- Comprehensive: Captures all relevant memory state
Implementations§
Source§impl SnapshotEngine
impl SnapshotEngine
Sourcepub fn new(event_store: SharedEventStore) -> Self
pub fn new(event_store: SharedEventStore) -> Self
Create a new SnapshotEngine
Sourcepub fn build_snapshot(&self) -> MemorySnapshot
pub fn build_snapshot(&self) -> MemorySnapshot
Build a snapshot from the current event store state
This method reads all events from the event store and constructs a snapshot representing the current memory state.
Sourcepub fn build_snapshot_from_events(
&self,
events: Vec<MemoryEvent>,
) -> MemorySnapshot
pub fn build_snapshot_from_events( &self, events: Vec<MemoryEvent>, ) -> MemorySnapshot
Build a snapshot from a specific set of events
§Arguments
events- The events to build the snapshot from
Sourcepub fn event_store(&self) -> &SharedEventStore
pub fn event_store(&self) -> &SharedEventStore
Get the event store reference
Auto Trait Implementations§
impl Freeze for SnapshotEngine
impl !RefUnwindSafe for SnapshotEngine
impl Send for SnapshotEngine
impl Sync for SnapshotEngine
impl Unpin for SnapshotEngine
impl UnsafeUnpin for SnapshotEngine
impl !UnwindSafe for SnapshotEngine
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more