# HG changeset patch # User Georges Racinet # Date 1576118807 -3600 # Node ID ab3fd8077f5ea557d476e00ee3d95cf0bfc4bea5 # Parent f384d68d8ea8ab97e83a65f45cb6894c634c43c4 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 diff -r f384d68d8ea8 -r ab3fd8077f5e 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 {