diff --git a/src/services/filter_service.rs b/src/services/filter_service.rs
index 5212d2e..aa57b90 100644
--- a/src/services/filter_service.rs
+++ b/src/services/filter_service.rs
@@ -4,13 +4,63 @@ use std::io::{Result, Read, Write};
use once_cell::sync::Lazy;
use std::sync::Mutex;
+/// Service for managing filter chains and plugin registration.
+///
+/// The `FilterService` provides functionality to parse filter strings, create filter chains,
+/// and apply them to input/output streams. It integrates with the global filter plugin
+/// registry to support dynamic loading of filter implementations like `head`, `tail`,
+/// `grep`, and custom plugins.
+///
+/// # Usage
+///
+/// ```rust
+/// let service = FilterService::new();
+/// let chain = service.create_filter_chain(Some("head_lines(10)")).unwrap();
+/// service.filter_data(&mut chain, &mut reader, &mut writer)?;
+/// ```
pub struct FilterService;
impl FilterService {
+ /// Creates a new `FilterService` instance.
+ ///
+ /// # Returns
+ ///
+ /// A new `FilterService`.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// let service = FilterService::new();
+ /// ```
pub fn new() -> Self {
Self
}
+ /// Creates a filter chain from a filter string specification.
+ ///
+ /// Parses the filter string using the filter parser and constructs a `FilterChain`
+ /// with the appropriate plugins. Returns `None` if no filter string is provided.
+ ///
+ /// # Arguments
+ ///
+ /// * `filter_str` - Optional filter string, e.g., "head_lines(10),grep(pattern=error)".
+ ///
+ /// # Returns
+ ///
+ /// * `Result