pub trait VarProvider: Send + Sync {
// Required methods
fn list(&self) -> Result<Vec<VarSummary>, ProviderError>;
fn get_value(
&self,
id: VarId,
) -> Result<Option<SecretString>, ProviderError>;
}Expand description
Read-side data source for the dashboard.
Implementations adapt the registry / manifest / store layer into
the flat VarSummary row representation the TUI consumes. The
trait is intentionally narrow so adapters can be added incrementally
(an in-memory test stub today, a RegistryService wrapper tomorrow,
a remote facade later) without churning view code.
Implementations must be safe to share across threads.
Required Methods§
Sourcefn list(&self) -> Result<Vec<VarSummary>, ProviderError>
fn list(&self) -> Result<Vec<VarSummary>, ProviderError>
Return the full list of variables. The dashboard re-runs this on explicit refresh, so the implementation should make each call deterministic with respect to the underlying state at call time.
§Errors
Returns ProviderError if the backend is unreachable or
returns an error. The TUI surfaces the message as a toast.
Sourcefn get_value(&self, id: VarId) -> Result<Option<SecretString>, ProviderError>
fn get_value(&self, id: VarId) -> Result<Option<SecretString>, ProviderError>
Resolve the actual (decrypted) value of a variable.
Used by the v key in the TUI to surface the value inside a
view-value modal. Returns None if the variable’s metadata
exists but its value is missing in the secret tier (rare —
usually indicates external tampering).
§Errors
Returns ProviderError on storage failure.