Skip to main content

errcode/
lib.rs

1#![no_std]
2extern crate alloc;
3
4mod error;
5mod error_code;
6mod error_impl;
7mod macros;
8mod traits;
9
10pub use errcode_derive::ErrorCode;
11pub use error::{Error, ErrorFrame, ErrorFrameIter, ErrorInfo};
12pub use error_code::ErrorCode;
13
14/// A module containing helpful imports for using this crate.
15pub mod prelude {
16    use crate::Error;
17
18    /// A convince wrapper over the [`Result`](`core::result::Result`) type.
19    pub type Result<T> = core::result::Result<T, Error>;
20
21    pub use crate::traits::{ConvertErrorHelper, IntoErrorHelper};
22}
23
24/// NOT PUBLIC API!
25#[doc(hidden)]
26pub mod __macro_export {
27    pub use crate::error::new_error_info;
28    pub use crate::error_code::{ErrorCodeInfo, ErrorCodePrivate};
29    pub use crate::error_impl::{DecodedLocation, ErrorInfoImpl, StaticMessageInfo};
30    pub use crate::macros::{get_helper, static_message, wrap_code};
31    pub use core;
32    pub use core::option::Option::{None, Some};
33}