Skip to main content

ConfigWatch

Trait ConfigWatch 

Source
pub trait ConfigWatch:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn watch(&self, cancel: CancellationToken) -> AppResult<ConfigChangeStream>;
}
Expand description

Adapter contract for configuration backends that emit change notifications.

Implemented by backends that can signal updates (a watched file, a remote config service, an in-memory store). The returned stream is bounded and owned; cancellation is driven by the supplied CancellationToken per the rskit concurrency baseline (ownership + cancellation + shutdown).

Required Methods§

Source

fn watch(&self, cancel: CancellationToken) -> AppResult<ConfigChangeStream>

Subscribe to configuration changes until cancel is triggered.

The returned stream yields ConfigChange events and completes once cancel fires or the source is dropped.

§Errors

Returns a typed AppError (cause preserved) if the backend cannot establish a watch.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ConfigWatch for InMemoryConfigSink

Available on crate feature watch only.