Skip to main content

Library/Struct/Binary/Command/
Entry.rs

1/// Represents the structure for binary command entries.
2///
3/// This struct holds various fields related to the command entries, including
4/// the entry paths, parallel execution flag, pattern to match, separator for
5/// file paths, and omit patterns.
6pub struct Struct {
7	/// A vector of vectors, where each inner vector contains the components of
8	/// a file path.
9	pub Entry:Type,
10
11	/// A flag indicating whether to execute commands in parallel.
12	pub Parallel:Parallel,
13
14	/// A string pattern to match against the last element of each entry.
15	pub Pattern:Pattern,
16
17	/// The separator used for file paths.
18	pub Separator:Separator,
19
20	/// A vector of strings representing patterns to omit.
21	pub Omit:Omit,
22}
23
24impl Struct {
25	/// Creates a new instance of the Struct.
26	///
27	/// This function initializes the Struct with the provided options,
28	/// generating the entry paths and cloning the omit patterns, parallel
29	/// flag, pattern, and separator from the options.
30	///
31	/// # Arguments
32	///
33	/// * `Option` - A reference to an Option struct containing initialization
34	///   parameters.
35	///
36	/// # Returns
37	///
38	/// Returns a new instance of Struct.
39	pub fn Fn(Option:&Option) -> Self {
40		Self {
41			Entry:crate::Fn::Binary::Command::Entry::Fn(Option),
42			Omit:Option.Omit.clone(),
43			Parallel:Option.Parallel,
44			Pattern:Option.Pattern.clone(),
45			Separator:Option.Separator,
46		}
47	}
48}
49
50use crate::Struct::Binary::Command::Option::{Omit, Parallel, Pattern, Separator, Struct as Option};
51
52/// Type alias for a vector of vectors, where each inner vector contains the
53/// components of a file path.
54pub type Type = Vec<Vec<String>>;