rust/hg-cpython/src/ref_sharing.rs
changeset 43272 00222775d59b
parent 43180 b3dda04e851b
child 43284 ce6dd1cee4c8
equal deleted inserted replaced
43271:99394e6c5d12 43272:00222775d59b
   177         data: &'a PySharedRefCell<T>,
   177         data: &'a PySharedRefCell<T>,
   178     ) -> Self {
   178     ) -> Self {
   179         Self { py, owner, data }
   179         Self { py, owner, data }
   180     }
   180     }
   181 
   181 
   182     pub fn borrow(&self) -> Ref<T> {
   182     pub fn borrow(&self) -> Ref<'a, T> {
   183         self.data.borrow()
   183         self.data.borrow()
   184     }
   184     }
   185 
   185 
   186     pub fn borrow_mut(&self) -> PyResult<PyRefMut<'a, T>> {
   186     pub fn borrow_mut(&self) -> PyResult<PyRefMut<'a, T>> {
   187         self.data.borrow_mut(self.py)
   187         self.data.borrow_mut(self.py)