[−][src]Crate custom_codes
This are Custom Enum codes for memorable and uniform response codes.
Enums are cheaper to compare and harder to get wrong than strings thereby guaranteeing efficiency.
Examples
Create codes for File Operations
use custom_codes::FileOps; fn open_file(file_name: &str) -> FileOps { match std::fs::File::create(file_name) { Ok(_) => FileOps::CreateTrue, Err(_) => FileOps::CreateFalse, } } fn main() { open_file("foo.txt"); }
Enums
| AccessStatus | Access status of token or access |
| ActivityStatus | Status of an activity |
| ActivityToggle | Initialize an activity |
| Cli | Command Line Options |
| Compression | Compression of files, bytes or directories |
| CustomBool | Creates a custom |
| DateTimeOp | Date and time custom codes |
| DbOps | Custom Response Codes Using Enums For Efficient Comparison |
| ExecCommand | Command Operations for execution |
| FileOps | File operations |
| GenericOutcome | Give the Generic Outcome of an operation with custom result as a generic |
| HardwareResources | Hardware Resources of a physical computer |
| Networking | Networking Specific |
| Outcome | Give the Outcome of an operation |
| SecHardware | Hardware security access |
| SecOps | Security operations on encryption and keys |
| Subscription | Status of a subscription that happens over a timespec |