Library/Struct/Binary/
Command.rs

1/// Represents the structure for binary command execution.
2///
3/// This struct holds various fields related to the command execution, including the separator for file paths
4/// and a function to execute the command asynchronously.
5pub struct Struct {
6	/// The separator used for file paths.
7	pub Separator: Option::Separator,
8
9	/// A boxed asynchronous function that returns a pinned future.
10	pub Fn: Box<dyn Fn() -> Pin<Box<dyn Future<Output = ()> + Send + 'static>> + Send + 'static>,
11}
12
13impl Struct {
14	/// Creates a new instance of the Struct.
15	///
16	/// This function initializes the Struct with the default file path separator and an asynchronous function
17	/// that executes the command based on the provided options. The function determines whether to execute
18	/// the command in parallel or sequentially based on the `Parallel` flag in the options.
19	///
20	/// # Returns
21	///
22	/// Returns a new instance of Struct.
23	pub fn Fn() -> Self {
24		Self {
25			Separator: std::path::MAIN_SEPARATOR,
26			Fn: Box::new(|| {
27				Box::pin(async move {
28					let Option = Entry::Struct::Fn(&Option::Struct::Fn(Struct::Fn()));
29
30					match Option.Parallel {
31						true => {
32							Parallel::Fn(Option).await;
33						}
34						false => {
35							Sequential::Fn(Option).await;
36						}
37					};
38				})
39			}),
40		}
41	}
42}
43
44use futures::Future;
45use std::pin::Pin;
46
47pub mod Entry;
48pub mod Option;
49
50use crate::Fn::Binary::Command::{Parallel, Sequential};