Expand description
Error code library provides generic errno/winapi error wrapper
User can define own Category if you want to create new error wrapper.
§Features
std- Enablesstd::error::Errorimplementation and conversion fromstd::io::Error
§Usage
use error_code::ErrorCode;
use std::fs::File;
File::open("non_existing");
println!("{}", ErrorCode::last_system());Modules§
Macros§
- define_
category - Defines error code
Categoryas enum which implements conversion into generic ErrorCode
Structs§
Constants§
- FAIL_
ERROR_ FORMAT - Text to return when error fails to be converted into utf-8
- MESSAGE_
BUF_ SIZE - Error message buffer size
- UNKNOWN_
ERROR Deprecated - Text to return when cannot map error
Statics§
- POSIX_
CATEGORY - Posix error category, suitable for all environments.
- SYSTEM_
CATEGORY - System error category, suitable for all environments.
Type Aliases§
- Message
Buf - Type alias for buffer to hold error code description.
- Result
- Type alias for Result with
ErrorCodeas error variant by default