pub struct ErasureCascadeObserver { /* private fields */ }Expand description
L2 observer that drives the E-user-3 cascade. On every
UserErasureScheduled event it:
- Looks up the user’s encrypted-PII rows via the attached
PiiRowStore. - Calls
PiiRowStore::tombstoneto mark every row soft-deleted. - Invokes the attached
DekShredderto drop the underlying DEK. - Records an
ErasureCompletionthe caller can convert into aUserErasureCompletedevent on the next tick.
The observer holds its own cursor — the router still centralises
dedup + gap detection via the Projection trait.
Implementations§
Source§impl ErasureCascadeObserver
impl ErasureCascadeObserver
Sourcepub fn new(rows: Box<dyn PiiRowStore>, shredder: Box<dyn DekShredder>) -> Self
pub fn new(rows: Box<dyn PiiRowStore>, shredder: Box<dyn DekShredder>) -> Self
Construct the observer with concrete backends.
Sourcepub fn drain_completions(&mut self) -> Vec<ErasureCompletion>
pub fn drain_completions(&mut self) -> Vec<ErasureCompletion>
Drain accumulated ErasureCompletions. The caller feeds each
one back into an ActionContext::emit_event(UserErasureCompleted { ... }) so the next WAL tick anchors the receipt.
Sourcepub fn pii_rows(&self) -> &dyn PiiRowStore
pub fn pii_rows(&self) -> &dyn PiiRowStore
Borrow the store for inspection — tests only.
Sourcepub fn shredder(&self) -> &dyn DekShredder
pub fn shredder(&self) -> &dyn DekShredder
Borrow the shredder for inspection — tests only.
Sourcepub fn into_completed_event(
completion: &ErasureCompletion,
schema_version: u16,
transparency_log_index: u64,
) -> UserErasureCompleted
pub fn into_completed_event( completion: &ErasureCompletion, schema_version: u16, transparency_log_index: u64, ) -> UserErasureCompleted
Convenience — build a UserErasureCompleted event from a
drained completion. The caller chooses the schema_version /
transparency log index from its own anchor; this helper wires
the remaining five fields.
Sourcepub fn per_region_events(
completion: &ErasureCompletion,
schema_version: u16,
) -> Vec<PerRegionErasureProgress>
pub fn per_region_events( completion: &ErasureCompletion, schema_version: u16, ) -> Vec<PerRegionErasureProgress>
Convenience — fan out a completion’s per-region progress entries
as PerRegionErasureProgress events (two-phase
commit). Single-region backends emit one event; multi-
region backends emit one event per participating region. The
caller emits these before the terminal UserErasureCompleted
receipt so external consumers see the full erasure transcript.