[][src]Crate error_code

Alternative Error

It's goal is to be able to provide simplified Error which would work in no_std environment

Requirements

  • alloc - Crate uses allocator to create dynamic message, when necessary (Only System category uses heap on Windows).

Features

  • std - enables std::error::Error implementation
  • ufmt - enables ufmt formatting implementation

Categories

Library introduces the concept of categories, similar to that of C++ std::error_category. Each category can be used to describe set of integral error codes.

Following implementations are builtin:

  • Posix - POSIX category. To access integer constants use libc
  • System - System category. To access integer constants use libc on unix, and winapi on Windows
  • Plain - Plain errors without any category.

Structs

ErrorCode

Describes error code in particular category.

PosixCategory

Posix error category, suitable for all environments.

SystemCategory

System error category, suitable for all environments.

Traits

Category

Describes category of Error, defining it's semantics.

Type Definitions

PlainError

Alias to Plain error code, without any extra category

PosixError

Alias to Posix error code

SystemError

Alias to System error code