Skip to main content

tuwunel_core/utils/
result.rs

1//! Result aliases and composable result extensions.
2//!
3//! The module covers filtering, inspection, logging, flattening, and
4//! expectation helpers. Most adapters preserve the original result type.
5
6mod and_then_ref;
7mod debug_inspect;
8mod expect_unchecked;
9mod filter;
10mod flat_ok;
11mod inspect_log;
12mod into_is_ok;
13mod is_err_or;
14mod log_debug_err;
15mod log_err;
16mod map_expect;
17mod map_ref;
18mod not_found;
19mod unwrap_infallible;
20mod unwrap_or_err;
21
22#[cfg(test)]
23mod tests;
24
25pub use self::{
26	and_then_ref::AndThenRef,
27	debug_inspect::DebugInspect,
28	expect_unchecked::ExpectUnchecked,
29	filter::Filter,
30	flat_ok::FlatOk,
31	inspect_log::{ErrDebugLog, ErrLog},
32	into_is_ok::IntoIsOk,
33	is_err_or::IsErrOr,
34	log_debug_err::LogDebugErr,
35	log_err::LogErr,
36	map_expect::MapExpect,
37	map_ref::MapRef,
38	not_found::NotFound,
39	unwrap_infallible::UnwrapInfallible,
40	unwrap_or_err::UnwrapOrErr,
41};
42
43/// Standard result type for core operations.
44///
45/// The success type defaults to `()`, while the error type defaults to the
46/// crate's [`crate::Error`]. Callers may override either type parameter.
47pub type Result<T = (), E = crate::Error> = std::result::Result<T, E>;