equal
deleted
inserted
replaced
134 inner: RefCell::new(value), |
134 inner: RefCell::new(value), |
135 py_shared_state: PySharedState::default(), |
135 py_shared_state: PySharedState::default(), |
136 } |
136 } |
137 } |
137 } |
138 |
138 |
139 pub fn borrow(&self) -> Ref<T> { |
139 pub fn borrow<'a>(&'a self, _py: Python<'a>) -> Ref<'a, T> { |
140 // py_shared_state isn't involved since |
140 // py_shared_state isn't involved since |
141 // - inner.borrow() would fail if self is mutably borrowed, |
141 // - inner.borrow() would fail if self is mutably borrowed, |
142 // - and inner.borrow_mut() would fail while self is borrowed. |
142 // - and inner.borrow_mut() would fail while self is borrowed. |
143 self.inner.borrow() |
143 self.inner.borrow() |
144 } |
144 } |
178 ) -> Self { |
178 ) -> Self { |
179 Self { py, owner, data } |
179 Self { py, owner, data } |
180 } |
180 } |
181 |
181 |
182 pub fn borrow(&self) -> Ref<'a, T> { |
182 pub fn borrow(&self) -> Ref<'a, T> { |
183 self.data.borrow() |
183 self.data.borrow(self.py) |
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) |
188 } |
188 } |