MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / validate_generation

Method validate_generation

src/sharedref.rs:386–395  ·  view source on GitHub ↗
(&self, py: Python)

Source from the content-addressed store, hash-verified

384 }
385
386 fn validate_generation(&self, py: Python) -> PyResult<()> {
387 if self.state.current_generation(py) == self.generation {
388 Ok(())
389 } else {
390 Err(PyErr::new::<exc::RuntimeError, _>(
391 py,
392 "Cannot access to leaked reference after mutation",
393 ))
394 }
395 }
396}
397
398impl<T> UnsafePyLeaked<T> {

Callers 3

try_borrowMethod · 0.80
try_borrow_mutMethod · 0.80
mapMethod · 0.80

Calls 1

current_generationMethod · 0.80

Tested by

no test coverage detected