Skip to main content

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