diff --git a/Cargo.toml b/Cargo.toml index 87bbc54..75e1d42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,8 +20,8 @@ walkdir = "2.5.0" futures = "0.3.30" rayon = "1.10.0" tokio = { version = "1.40.0", features = ["full"] } -num_cpus = "1.16.0" once_cell = "1.19.0" +num_cpus = "1.16.0" [build-dependencies] serde = { version = "1.0.210", features = ["derive"] } diff --git a/Source/Fn/Binary/Command/Parallel.rs b/Source/Fn/Binary/Command/Parallel.rs index 7cd77f4..30663ba 100644 --- a/Source/Fn/Binary/Command/Parallel.rs +++ b/Source/Fn/Binary/Command/Parallel.rs @@ -1,14 +1,34 @@ pub mod GPG; pub mod Process; -/// The function takes an Option containing Entry, Separator, Pattern, Command, and other values, -/// processes the Entry based on the Pattern and Separator, executes a Command with the processed Entry -/// as the current directory, and prints the output of each Command execution. +/// Executes a command pipeline based on input entries and a pattern. /// -/// Arguments: +/// This function processes a set of string entries, filters them based on a pattern, +/// and then executes a command pipeline for each matching entry. The results of each +/// pipeline execution are then sent through a channel for further processing. /// -/// The `Option` enum has fields named `Entry`, `Separator`, `Pattern`, `Command`, and possibly other -/// fields. +/// # Arguments +/// +/// * `options`: An optional struct containing the following fields: +/// * `Entry`: A vector of string slices representing the input entries. +/// * `Separator`: A string slice used to join the filtered parts of an entry. +/// * `Pattern`: A string slice representing the pattern to filter entries. +/// * `Command`: A vector of string slices representing the command pipeline to execute. +/// +/// # Example +/// +/// ``` +/// use your_crate::Fn; +/// +/// let options = Some(YourOptionStruct { +/// Entry: vec!["entry1/part1", "entry1/part2", "entry2/part1"], +/// Separator: "/", +/// Pattern: "part2", +/// Command: vec!["echo hello", "grep world"], +/// }); +/// +/// tokio::runtime::Runtime::new().unwrap().block_on(Fn(options)); +/// ``` pub async fn Fn(Option { Entry, Separator, Pattern, Command, .. }: Option) { let (Approval, mut Receive) = tokio::sync::mpsc::unbounded_channel(); @@ -24,7 +44,7 @@ pub async fn Fn(Option { Entry, Separator, Pattern, Command, .. }: Option) { .collect::>() }) .await - .expect("Cannot blocking."); + .expect("Cannot spawn_blocking."); futures::stream::iter(Entry.into_iter()) .map(|Entry| { diff --git a/Target/release/Inn.exe b/Target/release/Inn.exe index 35c131c..22e867f 100644 Binary files a/Target/release/Inn.exe and b/Target/release/Inn.exe differ diff --git a/Target/release/InnKeeper.exe b/Target/release/InnKeeper.exe index a9f1e90..1502df5 100644 Binary files a/Target/release/InnKeeper.exe and b/Target/release/InnKeeper.exe differ diff --git a/Target/release/PRun.exe b/Target/release/PRun.exe index d976aa4..3225f0c 100644 Binary files a/Target/release/PRun.exe and b/Target/release/PRun.exe differ diff --git a/Target/release/Run.exe b/Target/release/Run.exe index ad7579e..08d6d7a 100644 Binary files a/Target/release/Run.exe and b/Target/release/Run.exe differ