pub trait StatePublisher: Send + Sync {
// Required methods
fn on_record(&self, table: &str, record_id: &str, encrypted: &[u8]);
fn on_delete(&self, table: &str, record_id: &str);
}Expand description
Sink for vault-state changes so a node can replicate its redb records to a standby (the
keep-state-over-wisp design). keep-web installs an implementation that publishes each change as a
Nostr event; keep-core only signals table/record/bytes and never touches the network. on_record
carries the record’s already-encrypted redb bytes – the exact bytes stored – so a peer that
shares the vault key stores them verbatim. Called from inside the write path, so an implementation
MUST NOT block: enqueue and return.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".