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
22pub use self::{
23	and_then_ref::AndThenRef,
24	debug_inspect::DebugInspect,
25	expect_unchecked::ExpectUnchecked,
26	filter::Filter,
27	flat_ok::FlatOk,
28	inspect_log::{ErrDebugLog, ErrLog},
29	into_is_ok::IntoIsOk,
30	is_err_or::IsErrOr,
31	log_debug_err::LogDebugErr,
32	log_err::LogErr,
33	map_expect::MapExpect,
34	map_ref::MapRef,
35	not_found::NotFound,
36	unwrap_infallible::UnwrapInfallible,
37	unwrap_or_err::UnwrapOrErr,
38};
39
40/// Standard result type for core operations.
41///
42/// The success type defaults to `()`, while the error type defaults to the
43/// crate's [`crate::Error`]. Callers may override either type parameter.
44pub type Result<T = (), E = crate::Error> = std::result::Result<T, E>;