Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From apperr-0.1.0 To apperr-0.2.0
2024-01-14
| ||
09:42 | Cleanup changelog. Leaf check-in: 8b4c57bd25 user: jan tags: trunk | |
09:26 | Release maintenance. check-in: dd1cb44b41 user: jan tags: trunk, apperr-0.2.0 | |
09:18 | Add a Blessed trait and make it, and std::error::Error, a requirement for the AppErr::new() constructor. check-in: 5300d25ee8 user: jan tags: trunk | |
2023-12-12
| ||
05:01 | Release maintenance. check-in: 384535b834 user: jan tags: trunk, apperr-0.1.0 | |
2023-12-11
| ||
15:55 | Crate metadata. check-in: f36ab0b281 user: jan tags: trunk | |
Changes to Cargo.toml.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + - - | [package] name = "apperr" |
Changes to src/lib.rs.
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 | 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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | + + + + + + + + + + - + + + + + + + + + + + + + + - + + - + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + | //! _AppErr_ is a wrapper object intended to hold application-specific errors. //! //! The archetypal use-case is to allow applications that call library //! runtimes which call application callbacks to allow the application //! callbacks to return application-specific errors back to itself through the //! runtime. //! //! In order to lessen the risk of wrapping an unintended type, the [`AppErr`] //! constructor only take in types that implement [`apperr::Blessed`](Blessed) //! (which is a subtrait of [`std::error::Error`]). //! //! # Alternatives //! There are other ways to solve the same problem, but they are not always //! feasible. //! - Traits can use associated types to declare the application-specific error //! types. //! - A generic parameter can be used to declare the application-specific error //! type. //! - Global variables can be used to store error information. use std::any::Any; /// Marker trait used to bless a type so that it can be used as a /// application-specific error. pub trait Blessed: std::error::Error {} /// An error type used to pass an application-specific error through a library /// runtime. /// /// Application callbacks can return this type for the `Err()` case in order /// to allow application-defined errors to be passed back to the application /// through a library runtime. #[repr(transparent)] #[derive(Debug)] pub struct AppErr(Box<dyn Any + Send + 'static>); impl AppErr { /// Create a new application callback error object that can be converted back /// into to its original type (as long as it is [`Any`] compatible). /// /// ``` /// use std::fmt; |
︙ |
Changes to www/changelog.md.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + | # Change Log ## [Unreleased] ### Added - Add a `Blessed` trait used to mark types as allowed to be wrapped by `AppErr`. ### Changed - The `AppErr::new()` constructor's input now must implement `std::error::Error` and `apperr::Blessed` to lessen the risk that wrong type is passed by accident (avoid things like the `Result` being passed instead of the error type). ### Removed --- ## [0.2.0] - 2024-01-14 [Details](/vdiff?from=apperr-0.1.0&to=apperr-0.2.0) ### Added - Add a `Blessed` trait used to mark types as allowed to be wrapped by `AppErr`. ### Changed - The `AppErr::new()` constructor's input now must implement `std::error::Error` and `apperr::Blessed` to lessen the risk that wrong type is passed by accident (avoid things like the `Result` being passed instead of the error type). --- ## [0.1.0] - 2023-12-12 - Initial release. |
Changes to www/index.md.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + - | # AppErr |
︙ |