pub struct Program<Namespace> {
pub namespaces: Vec<Namespace>,
}Expand description
Represents a program that contains one or more namespaces, where each namespace contains a list of commands.
A Program consists of one or more Namespaces, where each namespace contains a list of commands.
The Namespace can be any type that represents a namespace of commands, such as ParsedCommand, VerifiedCommand, or ExecutableCommand_.
The program can be executed by iterating over each namespace and executing its commands sequentially or in parallel.
§Example:
let namespace1 = Namespace
{
commands : vec!
[
ParsedCommand
{
name : "cmd1".to_string(),
subjects : vec![ "sub1".to_string() ],
properties: HashMap::new(),
},
ParsedCommand
{
name: "cmd2".to_string(),
subjects: vec![ "sub2".to_string(), "sub3".to_string() ],
properties: HashMap::new(),
},
],
};
let namespace2 = Namespace
{
commands : vec!
[
ParsedCommand
{
name : "cmd1".to_string(),
subjects : vec![ "sub1".to_string() ],
properties: HashMap::new(),
},
],
};
let program = Program { namespaces : vec![ namespace1, namespace2, /* ... */ ] };In the above example, a Program is created with two Namespace objects. Each namespace contains a different set of ParsedCommand objects with different sets of subjects. The Program can be executed by iterating over each namespace and executing its commands in sequence.
Fields§
§namespaces: Vec<Namespace>list of namespaces with commands