rust-index: add a `inner` method to the Index struct
authorGeorges Racinet <georges.racinet@octobus.net>
Thu, 12 Dec 2019 03:46:47 +0100
changeset 43960 ab3fd8077f5e
parent 43959 f384d68d8ea8
child 43961 b69d5f3a41d0
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
rust/hg-cpython/src/cindex.rs
--- 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 {