pub struct Namespace<Command> {
pub commands: Vec<Command>,
}Expand description
Represents a namespace of commands with the specified Command type. This is done to be flexible and not to duplicate code.
A Namespace contains a list of commands, where each command can be a ParsedCommand, VerifiedCommand, ExecutableCommand_, or any other command type that you define.
In the future, each namespace can be executed in parallel. This means that commands in namespace will be executed synchronous but each namespace can be executed in parallel to each other.
§Example:
let 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(),
},
ParsedCommand
{
name : "cmd3".to_string(),
subjects: vec![],
properties: HashMap::new(),
},
/* ... */
];
let namespace = Namespace { commands };In the above example, a Namespace is created with three ParsedCommand objects. Each command has a different set of subjects.
Fields§
§commands: Vec<Command>list of commands
Trait Implementations§
source§impl<Command: PartialEq> PartialEq for Namespace<Command>
impl<Command: PartialEq> PartialEq for Namespace<Command>
impl<Command: Eq> Eq for Namespace<Command>
impl<Command> StructuralPartialEq for Namespace<Command>
Auto Trait Implementations§
impl<Command> RefUnwindSafe for Namespace<Command>where
Command: RefUnwindSafe,
impl<Command> Send for Namespace<Command>where
Command: Send,
impl<Command> Sync for Namespace<Command>where
Command: Sync,
impl<Command> Unpin for Namespace<Command>where
Command: Unpin,
impl<Command> UnwindSafe for Namespace<Command>where
Command: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more