1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Command trait - Defines the interface for all command implementations
// Copyright (C) 2025 Marc Rivero (@seifreed)
// Licensed under GPL-3.0
use crateResult;
use async_trait;
/// Command trait - Defines the interface for all command implementations
///
/// This trait follows the Command Pattern to encapsulate different
/// operational modes of CipherRun as independent, testable command objects.
///
/// Each command is responsible for:
/// - Validating its own preconditions
/// - Executing its specific operational logic
/// - Handling errors appropriately
/// - Returning a Result indicating success or failure
///
/// # Design Principles
/// - Single Responsibility: Each command handles one operational mode
/// - Open/Closed: New commands can be added without modifying existing code
/// - Interface Segregation: Commands only depend on what they need
/// - Dependency Inversion: High-level main() depends on Command abstraction
///
/// # License
/// All implementations must be released under GNU General Public License v3 (GPLv3)
/// Author: Marc Rivero López