We dont need the command traits anymore
This commit is contained in:
parent
84571bef0a
commit
8af9ba48c0
3 changed files with 1 additions and 25 deletions
|
@ -13,7 +13,6 @@ mod commands;
|
|||
use self::header::build_header;
|
||||
use storage::json::parser::JsonHeaderParser;
|
||||
use storage::parser::FileHeaderParser;
|
||||
use module::command::ExecutableCommand;
|
||||
|
||||
use self::commands::add::*;
|
||||
use self::commands::list::*;
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
use std::result::Result;
|
||||
|
||||
use clap::ArgMatches;
|
||||
|
||||
use runtime::Runtime;
|
||||
use super::ModuleError;
|
||||
use storage::backend::{StorageBackend, StorageBackendError};
|
||||
|
||||
pub type CommandError = Result<ModuleError, StorageBackendError>;
|
||||
pub type CommandResult = Result<(), Result<ModuleError, CommandError>>;
|
||||
|
||||
pub struct CommandEnv<'a> {
|
||||
pub rt: &'a Runtime<'a>,
|
||||
pub matches: &'a ArgMatches<'a, 'a>,
|
||||
pub backend: StorageBackend
|
||||
}
|
||||
|
||||
pub trait ExecutableCommand {
|
||||
fn get_callname() -> &'static str;
|
||||
fn exec(&self, env: CommandEnv) -> CommandResult;
|
||||
}
|
|
@ -6,10 +6,8 @@ use std::fmt::Display;
|
|||
use std::result::Result;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use storage::backend::StorageBackend;
|
||||
use self::command::ExecutableCommand;
|
||||
use storage::backend::{StorageBackend, StorageBackendError};
|
||||
|
||||
pub mod command;
|
||||
pub mod bm;
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Reference in a new issue