1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Ergonomic result types for API handlers
//!
//! This module provides type aliases and conversions to make error handling
//! in HTTP handlers more concise and uniform.
use crateProblem;
/// Standard result type for API operations
///
/// Use this throughout your handlers for consistent error handling:
///
/// ```ignore
/// async fn handler() -> ApiResult<Json<User>> {
/// let user = fetch_user().await?; // auto-converts errors to Problem
/// Ok(Json(user))
/// }
/// ```
///
/// The `?` operator automatically converts any error implementing
/// `Into<Problem>` (including `modkit_odata::Error`) into a Problem.
/// Problem implements `IntoResponse`, so Axum will automatically convert it
/// to an HTTP response when returned from a handler.
pub type ApiResult<T = > = ;