EventWithCommands

Trait EventWithCommands 

Source
pub trait EventWithCommands {
    // Required methods
    fn commands(&self) -> &[Command];
    fn commands_mut(&mut self) -> &mut Vec<Command>;
    fn to_string_cmd(&self, version: Version) -> Option<String>;

    // Provided methods
    fn try_push_cmd(
        &mut self,
        cmd: Command,
        indentation: usize,
    ) -> Result<(), CommandPushError> { ... }
    fn to_string_variables(
        &self,
        version: Version,
        variables: &[Variable],
    ) -> Option<String> { ... }
}

Required Methods§

Source

fn commands(&self) -> &[Command]

Source

fn commands_mut(&mut self) -> &mut Vec<Command>

Source

fn to_string_cmd(&self, version: Version) -> Option<String>

Returns the command as a String.

  • Instead of making the command into a string using Display or VersionedToString, use this to get the command as a string.

Provided Methods§

Source

fn try_push_cmd( &mut self, cmd: Command, indentation: usize, ) -> Result<(), CommandPushError>

Source

fn to_string_variables( &self, version: Version, variables: &[Variable], ) -> Option<String>

Returns the command as a String.

  • Contains the commands as a string as well.
  • Use this in the to_string method with an empty variables array.

Implementors§