MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / BTreeResultExt

Interface BTreeResultExt

rust/src/error.rs:110–121  ·  view source on GitHub ↗

Result extension trait for improved error handling

Source from the content-addressed store, hash-verified

108
109/// Result extension trait for improved error handling
110pub 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
123impl<T> BTreeResultExt<T> for Result<T, BPlusTreeError> {
124 fn with_context(self, context: &str) -> BTreeResult<T> {

Callers

nothing calls this directly

Implementers 1

error.rsrust/src/error.rs

Calls

no outgoing calls

Tested by

no test coverage detected