@@ -8,26 +8,26 @@ This provides Python builder classes so that Python users can easily create [`Ar
88
991 . Register the builders.
1010
11- ``` rs
12- #[pymodule]
13- fn python_module (py : Python , m : & Bound <PyModule >) -> PyResult <()> {
14- pyo3_object_store :: register_store_module (py , m , " python_module" , " store" )? ;
15- pyo3_object_store :: register_exceptions_module (py , m , " python_module" , " exceptions" )? ;
16- }
17- ```
11+ ``` rs
12+ #[pymodule]
13+ fn python_module (py : Python , m : & Bound <PyModule >) -> PyResult <()> {
14+ pyo3_object_store :: register_store_module (py , m , " python_module" , " store" )? ;
15+ pyo3_object_store :: register_exceptions_module (py , m , " python_module" , " exceptions" )? ;
16+ }
17+ ```
1818
1919 This exports the underlying Python classes from your own Rust - Python library .
2020
2121 Refer to [`register_store_module `] and [`register_exceptions_module `] for more information .
2222
23232 . Accept [`PyObjectStore `] as a parameter in your function exported to Python . Its [`into_dyn `][PyObjectStore :: into_dyn ] method (or `Into ` impl ) gives you an [`Arc <dyn ObjectStore >`][object_store :: ObjectStore ].
2424
25- ``` rs
26- #[pyfunction]
27- pub fn use_object_store (store : PyObjectStore ) {
28- let store : Arc <dyn ObjectStore > = store . into_dyn ();
29- }
30- ```
25+ ```rs
26+ #[pyfunction]
27+ pub fn use_object_store (store : PyObjectStore ) {
28+ let store : Arc <dyn ObjectStore > = store . into_dyn ();
29+ }
30+ ```
3131
3232 You can also accept [`AnyObjectStore `] as a parameter , which wraps [`PyObjectStore `] and [`PyExternalObjectStore `]. This allows you to seamlessly recreate `ObjectStore ` instances that users pass in from other Python libraries (like [`obstore `][obstore ]) that themselves export `pyo3 - object_store ` builders .
3333
@@ -39,6 +39,10 @@ The [`obstore`][obstore] Python library gives a full real-world example of using
3939
4040[obstore ]: https : // developmentseed.org/obstore/latest/
4141
42+ ## Feature flags
43+
44+ - `external - store - warning ` (enabled by default ): Emit a user warning when constructing a `PyExternalObjectStore ` (or `AnyObjectStore :: PyExternalObjectStore `), to inform users that there may be performance implications due to lack of connection pooling across separately - compiled Python libraries . Disable this feature if you don 't want the warning .
45+
4246## ABI stability
4347
4448It 's [not currently possible ](https : // github.com/PyO3/pyo3/issues/1444) to share a `#[pyclass]` across multiple Python libraries, except in special cases where the underlying data has a stable ABI.
0 commit comments