vidsage-core 0.1.0

Core functionality for VidSage video processing and AI commentary generation
Documentation
//! Config manager traits

use crate::Result;

/// Trait for configuration management functionality
#[async_trait::async_trait]
pub trait ConfigManager {
    /// Get a configuration value
    async fn get<T: serde::de::DeserializeOwned>(&self, key: &str) -> Result<T>;

    /// Set a configuration value
    async fn set<T: serde::Serialize + Send>(&self, key: &str, value: T) -> Result<()>;

    /// Delete a configuration value
    async fn delete(&self, key: &str) -> Result<bool>;

    /// Check if a configuration key exists
    async fn exists(&self, key: &str) -> Result<bool>;

    /// List all configuration keys
    async fn list_keys(&self) -> Result<Vec<String>>;

    /// Load configuration from file
    async fn load_from_file(&self, path: &std::path::Path) -> Result<()>;

    /// Save configuration to file
    async fn save_to_file(&self, path: &std::path::Path) -> Result<()>;

    /// Reload configuration from the source
    async fn reload(&self) -> Result<()>;
}