pavex/blueprint/
error_observer.rs

1use pavex_bp_schema::Blueprint as BlueprintSchema;
2
3use super::reflection::AnnotationCoordinates;
4
5/// The input type for [`Blueprint::error_observer`].
6///
7/// Check out [`Blueprint::error_observer`] for more information on error handling
8/// in Pavex.
9///
10/// # Stability guarantees
11///
12/// Use the [`error_observer`](macro@crate::error_observer) attribute macro to create instances of `ErrorObserver`.\
13/// `ErrorObserver`'s fields are an implementation detail of Pavex's macros and should not be relied upon:
14/// newer versions of Pavex may add, remove or modify its fields.
15///
16/// [`Blueprint::error_observer`]: crate::Blueprint::error_observer
17pub struct ErrorObserver {
18    #[doc(hidden)]
19    pub coordinates: AnnotationCoordinates,
20}
21
22/// The type returned by [`Blueprint::error_observer`].
23///
24/// # Future-proofing
25///
26/// As of today, [`RegisteredErrorObserver`] doesn't provide any additional functionality.\
27/// It is included to allow introducing new configuration for error observers without having
28/// to change the signature of [`Blueprint::error_observer`].
29///
30/// [`Blueprint::error_observer`]: crate::Blueprint::error_observer
31pub struct RegisteredErrorObserver<'a> {
32    #[allow(dead_code)]
33    pub(crate) blueprint: &'a mut BlueprintSchema,
34}