serenade-console 1.0.0

Console Application: discoverable commands (bin/console analogue)
Documentation
//! Command trait.

use crate::{ConsoleError, Input};

/// A discoverable console command (`foo:bar`).
pub trait Command: Send + Sync {
    /// Stable command name (for example `serenade:about`).
    fn name(&self) -> &'static str;

    /// One-line help shown by `list`.
    fn description(&self) -> &'static str;

    /// Runs the command.
    ///
    /// # Errors
    ///
    /// Returns [`ConsoleError`] when the command fails.
    fn execute(&self, input: &Input) -> Result<(), ConsoleError>;
}