#![cfg_attr(nightly, feature(error_generic_member_access))]
#![doc(html_no_source)]
#![doc = include_str!("../README.md")]
extern crate self as pi_result;
pub mod attachment;
pub mod boundary;
pub mod fmt;
pub mod inspect;
pub mod interop;
pub mod kind;
pub mod prelude;
pub mod result;
pub mod testing;
#[doc(hidden)]
#[path = "derive_support.rs"]
pub mod __derive_support_v1;
pub use error_stack;
pub use error_stack::{bail, ensure};
pub mod thiserror {
pub use ::thiserror::*;
pub use pi_result_macros::Error;
}
pub use crate::boundary::{IntoErrorExt, IntoTypedContextExt};
pub use crate::fmt::{debug_message, user_message, verbose_message};
pub use crate::inspect::ErrorInspectExt;
pub use crate::interop::{
ClassifyErrorKind, ExternalError, InteropResultExt, classify_io_error, source_type_name_of,
};
pub use crate::kind::ErrorKind;
pub use crate::prelude::*;
pub use crate::result::{Error, ErrorReport, RawResult, Result, TypedResult};
#[cfg(test)]
mod derive_entry_tests {
#[derive(Debug, crate::ThisError)]
#[error("crate-self derive")]
struct Local;
#[test]
fn test_crate_self_derive_resolves_the_private_self_alias() {
let local = Local;
let _: &dyn std::error::Error = &local;
assert_eq!(local.to_string(), "crate-self derive");
let report: crate::Error =
crate::Report::new(local).change_context(crate::ErrorKind::Other);
assert!(report.contains::<Local>());
assert_eq!(report.current_context(), &crate::ErrorKind::Other);
}
}