Result extension trait for improved error handling
| 108 | |
| 109 | /// Result extension trait for improved error handling |
| 110 | pub trait BTreeResultExt<T> { |
| 111 | /// Convert to a BTreeResult with additional context |
| 112 | fn with_context(self, context: &str) -> BTreeResult<T>; |
| 113 | |
| 114 | /// Convert to a BTreeResult with operation context |
| 115 | fn with_operation(self, operation: &str) -> BTreeResult<T>; |
| 116 | |
| 117 | /// Log error and continue with default value |
| 118 | fn or_default_with_log(self) -> T |
| 119 | where |
| 120 | T: Default; |
| 121 | } |
| 122 | |
| 123 | impl<T> BTreeResultExt<T> for Result<T, BPlusTreeError> { |
| 124 | fn with_context(self, context: &str) -> BTreeResult<T> { |
nothing calls this directly
no outgoing calls
no test coverage detected