File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,18 @@ use std::{ptr, slice};
1111
1212/// A custom implementation of an [`Odb`] backend.
1313///
14- /// # Errors
14+ /// Most of the default implementations of this trait's methods panic when called as they are
15+ /// intended to be overridden.
1516///
16- /// If the backend does not have enough memory, the error code should be
17- /// [`ErrorCode::GenericError`] and the class should be [`ErrorClass::NoMemory`].
17+ /// # Error recommendations
18+ ///
19+ /// Errors are generally left at the implementation's discretion; some recommendations are
20+ /// made regarding error codes and classes to ease implementation and usage of custom backends.
21+ ///
22+ /// Read the individual methods' documentation for more specific recommendations.
23+ ///
24+ /// If the backend does not have enough memory, the error SHOULD be code
25+ /// [`ErrorCode::GenericError`] and the class SHOULD be [`ErrorClass::NoMemory`].
1826#[ allow( unused_variables) ]
1927pub trait OdbBackend {
2028 /// Returns the supported operations of this backend.
@@ -163,6 +171,8 @@ pub trait OdbBackend {
163171 /// Requires that [`SupportedOperations::EXISTS`] is present in the value returned from
164172 /// [`supported_operations`] to expose it to libgit2.
165173 ///
174+ /// The default implementation of this method panics.
175+ ///
166176 /// # Implementation notes
167177 ///
168178 /// An implementation SHOULD return `Ok(true)` if the object exists, and `Ok(false)` if the
You can’t perform that action at this time.
0 commit comments