rust-index: add a `inner` method to the Index struct
We are about to introduce a Rust wrapper to the C index. It will be exposed as a
Python object. As a start all call will be forwarded to an internal index object
(as used now).
For this forwarding to works, we need to access that index object (from the C
extensions). We adds a method doing to on the existing `Index` rust struct.
Differential Revision: https://phab.mercurial-scm.org/D7654
--- a/rust/hg-cpython/src/cindex.rs Wed Nov 27 17:59:58 2019 +0100
+++ b/rust/hg-cpython/src/cindex.rs Thu Dec 12 03:46:47 2019 +0100
@@ -71,6 +71,11 @@
capi: unsafe { revlog_capi::retrieve(py)? },
})
}
+
+ /// return a reference to the CPython Index object in this Struct
+ pub fn inner(&self) -> &PyObject {
+ &self.index
+ }
}
impl Clone for Index {