docs: Enhance Rustdoc for CompressionService, StatusService, and MetaPluginExec
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
@@ -13,14 +13,23 @@ use std::str::FromStr;
|
||||
/// configuration, storage paths, compression engines, metadata plugins,
|
||||
/// and filter plugins. It provides a unified interface for status reporting
|
||||
/// used by both CLI and server modes.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let service = StatusService::new();
|
||||
/// let status = service.generate_status(&mut cmd, &settings, data_path, db_path);
|
||||
/// ```
|
||||
pub struct StatusService;
|
||||
|
||||
impl StatusService {
|
||||
/// Creates a new `StatusService` instance.
|
||||
///
|
||||
/// No specific initialization is needed; it's a stateless service.
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// A new `StatusService` instance.
|
||||
/// * `StatusService` - A new instance.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@@ -35,23 +44,28 @@ impl StatusService {
|
||||
///
|
||||
/// Collects data about paths, compression engines, available and configured
|
||||
/// meta plugins, and filter plugins. Uses the provided settings to determine
|
||||
/// enabled components.
|
||||
/// enabled components. Handles error reporting via Clap if needed.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `cmd` - Mutable reference to the Clap command for error reporting.
|
||||
/// * `settings` - Application settings containing configuration.
|
||||
/// * `data_path` - Path to the data storage directory.
|
||||
/// * `cmd` - Mutable reference to the Clap command for error reporting (e.g., invalid plugins).
|
||||
/// * `settings` - Application settings containing configuration details like enabled plugins.
|
||||
/// * `data_path` - Path to the data storage directory for item files.
|
||||
/// * `db_path` - Path to the SQLite database file.
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// `StatusInfo` - Structured status information.
|
||||
/// * `StatusInfo` - A structured object containing all status details, including paths, plugins, and config.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Exits via Clap error if invalid meta plugin types are configured in settings.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let status = service.generate_status(&mut cmd, &settings, data_path, db_path);
|
||||
/// assert!(!status.filter_plugins.is_empty());
|
||||
/// ```
|
||||
pub fn generate_status(
|
||||
&self,
|
||||
@@ -100,9 +114,11 @@ impl StatusService {
|
||||
impl Default for StatusService {
|
||||
/// Returns the default `StatusService` instance.
|
||||
///
|
||||
/// Delegates to `new()` for consistency.
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// A new `StatusService`.
|
||||
/// * `StatusService` - A new instance.
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user