pub struct StatementStoreSubscription<T: StatementTransport> { /* private fields */ }Implementations§
Source§impl<T: StatementTransport> StatementStoreSubscription<T>
impl<T: StatementTransport> StatementStoreSubscription<T>
Sourcepub fn new(transport: T, config: SubscriptionConfig) -> Self
pub fn new(transport: T, config: SubscriptionConfig) -> Self
Create a new subscription manager with the given transport and config.
Sourcepub fn add_handler(&self, handler: Arc<dyn StatementHandler>)
pub fn add_handler(&self, handler: Arc<dyn StatementHandler>)
Register a handler to receive decoded statements.
Sourcepub fn add_topics(&self, new_topics: &[Topic])
pub fn add_topics(&self, new_topics: &[Topic])
Add topics to subscribe to, deduplicating against existing topics.
If the subscription is already running, the reconnect loop will pick up the new topic set on the next reconnect cycle.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the subscription loop is running.
Sourcepub fn remove_topics(&self, to_remove: &[Topic])
pub fn remove_topics(&self, to_remove: &[Topic])
Remove topics from the subscription list.
If the subscription is already running, the reconnect loop will pick up the reduced topic set on the next reconnect cycle.
Sourcepub fn deliver(&self, raw: &[u8])
pub fn deliver(&self, raw: &[u8])
Decode, dedup, and dispatch a raw statement to all registered handlers.
This is the hot path. Signature verification is the handler’s responsibility; this layer only performs structural decoding and dedup.
On WASM the JS host calls this directly via pushStatement().
On native the reconnect loop calls this from the background thread.
Callers should check is_running() if they need stop semantics.