//! Wasmtime's universal error handling types. //! //! 99% API-compatible with `anyhow`, but additionally handles out-of-memory //! errors, instead of aborting the process. //! //! See the [`Error`] documentation for more details. #[cfg(feature = "backtrace")] mod backtrace; mod boxed; mod context; mod error; mod oom; mod ptr; mod to_wasmtime_result; mod vtable; #[doc(hidden)] pub mod macros; pub use crate::{bail, ensure, format_err}; #[cfg(feature = "backtrace")] pub use backtrace::disable_backtrace; pub use context::Context; pub use error::*; pub use oom::OutOfMemory; pub use to_wasmtime_result::ToWasmtimeResult; /// A result of either `Ok(T)` or an [`Err(Error)`][Error]. pub type Result = core::result::Result; /// Return `core::result::Result::::Ok(value)`. /// /// Useful in situations where Rust's type inference cannot figure out that the /// `Result`'s error type is [`Error`]. #[allow(non_snake_case, reason = "matching anyhow API")] pub fn Ok(value: T) -> Result { core::result::Result::Ok(value) }