changeset 43960:ab3fd8077f5e

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
author Georges Racinet <georges.racinet@octobus.net>
date Thu, 12 Dec 2019 03:46:47 +0100
parents f384d68d8ea8
children b69d5f3a41d0
files rust/hg-cpython/src/cindex.rs
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 {