pub struct CommandNoParameters {
name: String,
operation: fn(source: &mut CommandTextObject),
}
Expand description
Represents an operation that can be applied to a CommandTextObject with no additional parameters.
This struct implements the ICommand trait so it can be treated the same as any other kind of command.
Fields§
§name: String
Easy-to-read command name.
operation: fn(source: &mut CommandTextObject)
No parameter operation to apply to a CommandTextObject.
Implementations§
source§impl CommandNoParameters
impl CommandNoParameters
sourcepub fn new(
name: &str,
operation: fn(source: &mut CommandTextObject)
) -> Box<dyn ICommand>
pub fn new( name: &str, operation: fn(source: &mut CommandTextObject) ) -> Box<dyn ICommand>
Constructor for a command that applies an operation to a CommandTextObject but does not require any additional parameters.
Parameters
-
name
Easy-to-read name of the command.
-
operation
The operation to apply to a CommandTextObject and that takes no parameters.
Returns
Returns an ICommand object representing the command.