[−][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"); }
Macros
| downcast | Try downcasting any error to std::io::Error |
Structs
| StringifyError | Convert a |
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 |
| DownCastErrors | All common errors for use in crates. They mirror std::io::ErrorKind; |
| 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 |
| KeyLength | The length of a key in bytes needed by a cryptography algorithm |
| 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 |
Functions
| try_downcast | This method tries to downcast an |