Skip to main content

RyditModule

Trait RyditModule 

Source
pub trait RyditModule: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn version(&self) -> &'static str;
    fn register(&self) -> HashMap<&'static str, &'static str>;
    fn execute(&self, command: &str, params: Value) -> ModuleResult;
}
Expand description

Trait que todos los módulos deben implementar

Required Methods§

Source

fn name(&self) -> &'static str

Nombre único del módulo

Source

fn version(&self) -> &'static str

Versión del módulo

Source

fn register(&self) -> HashMap<&'static str, &'static str>

Registro de comandos disponibles Retorna: HashMap<nombre_comando, descripción>

Source

fn execute(&self, command: &str, params: Value) -> ModuleResult

Ejecuta un comando con parámetros

§Arguments
  • command - Nombre del comando
  • params - Parámetros JSON

Implementors§