docs: Add Rustdoc to gzip and user meta plugins, mark PLAN.md tasks done

Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-10 14:12:25 -03:00
parent ce9b823e17
commit 16c035eb50
3 changed files with 20 additions and 6 deletions

View File

@@ -27,6 +27,11 @@ use flate2::write::GzEncoder;
use crate::compression_engine::CompressionEngine;
#[derive(Debug, Eq, PartialEq, Clone, Default)]
/// GZip compression engine implementation.
///
/// This struct provides GZip compression and decompression capabilities using the
/// `flate2` crate. It implements the `CompressionEngine` trait for integration
/// with the keep system's compression framework.
pub struct CompressionEngineGZip {}
impl CompressionEngineGZip {
@@ -119,7 +124,7 @@ impl CompressionEngine for CompressionEngineGZip {
/// let writer = engine.create("/path/to/file.gz".into()).expect("Create failed");
/// ```
fn create(&self, file_path: PathBuf) -> Result<Box<dyn Write>> {
debug!("COMPRESSION: Writting to {:?} using {:?}", file_path, *self);
debug!("COMPRESSION: Writing to {:?} using {:?}", file_path, *self);
let file = File::create(file_path)?;
let gzip_write = GzEncoder::new(file, Compression::default());
@@ -128,6 +133,11 @@ impl CompressionEngine for CompressionEngineGZip {
}
}
#[derive(Debug)]
/// Wrapper around `GzEncoder` that automatically finishes the compression stream on drop.
///
/// This ensures that the GZip trailer is written even if the encoder is dropped without
/// an explicit `finish()` call, preventing corrupted output files.
pub struct AutoFinishGzEncoder<W: Write> {
encoder: Option<GzEncoder<W>>,
}

View File

@@ -1,6 +1,10 @@
use crate::meta_plugin::{MetaPlugin, MetaPluginType};
#[derive(Debug, Clone, Default)]
/// Meta plugin for capturing current user and group information.
///
/// This plugin collects user ID, group ID, username, and group name for the process
/// running the keep application, providing context about the creator of items.
pub struct UserMetaPlugin {
base: crate::meta_plugin::BaseMetaPlugin,
}