comparison rust/pyo3-sharedref/tests/test_sharedref.rs @ 52610:c25d345f5aa5

rust-pyo3-sharedref: renamed PySharedRefCell to PyShareable There were two problems with the naming: - the PyO3 version is not based on `RefCell`. Rather than calling this `SomethingRwLock` we decided it was best to consider this an implementation detail. We mentioned it in the doc earlier on, but that is merely just bringing some reassuring context to the reader, not intended to be a needed structural explanation. - the data is not shared: it is ready to be shared To keep the changeset readable, we only make the very minimal changes to the tests to make them pass, i.e., not renaming local variables (this will be done in a later move).
author Georges Racinet <georges.racinet@cloudcrane.io>
date Sun, 15 Dec 2024 15:03:27 +0100
parents d1e304025b90
children 4a73eb3923ac
comparison
equal deleted inserted replaced
52609:d1e304025b90 52610:c25d345f5aa5
1 use pyo3::prelude::*; 1 use pyo3::prelude::*;
2 use pyo3_sharedref::*; 2 use pyo3_sharedref::*;
3 3
4 #[pyclass] 4 #[pyclass]
5 struct Owner { 5 struct Owner {
6 string: PySharedRefCell<String>, 6 string: PyShareable<String>,
7 } 7 }
8 8
9 #[pymethods] 9 #[pymethods]
10 impl Owner { 10 impl Owner {
11 #[new] 11 #[new]