(self, context: C)
| 1166 | E: Into<StorageErrorXKind>, |
| 1167 | { |
| 1168 | fn context<C>(self, context: C) -> Result<T, StorageErrorX> |
| 1169 | where |
| 1170 | C: Display, |
| 1171 | { |
| 1172 | match self { |
| 1173 | Ok(val) => Ok(val), |
| 1174 | Err(kind) => Err(StorageErrorX { |
| 1175 | kind: kind.into(), |
| 1176 | context: LinkedList::from([context.to_string()]), |
| 1177 | }), |
| 1178 | } |
| 1179 | } |
| 1180 | } |
| 1181 | |
| 1182 | impl<T> StorageErrorXContext<T> for Result<T, StorageErrorX> { |