pyo3/
sealed.rs

1use crate::types::{
2    PyBool, PyByteArray, PyBytes, PyCapsule, PyComplex, PyDict, PyFloat, PyFrozenSet, PyList,
3    PyMapping, PyMappingProxy, PyModule, PySequence, PySet, PySlice, PyString, PyTraceback,
4    PyTuple, PyType, PyWeakref, PyWeakrefProxy, PyWeakrefReference,
5};
6use crate::{ffi, Bound, PyAny, PyResult};
7
8use crate::pyclass_init::PyClassInitializer;
9
10use crate::impl_::{
11    pyclass_init::PyNativeTypeInitializer,
12    pymethods::PyMethodDef,
13    pymodule::{AddClassToModule, AddTypeToModule, ModuleDef},
14};
15
16pub trait Sealed {}
17
18// for FfiPtrExt
19impl Sealed for *mut ffi::PyObject {}
20
21// for PyResultExt
22impl Sealed for PyResult<Bound<'_, PyAny>> {}
23
24// for Py(...)Methods
25impl Sealed for Bound<'_, PyAny> {}
26impl Sealed for Bound<'_, PyBool> {}
27impl Sealed for Bound<'_, PyByteArray> {}
28impl Sealed for Bound<'_, PyBytes> {}
29impl Sealed for Bound<'_, PyCapsule> {}
30impl Sealed for Bound<'_, PyComplex> {}
31impl Sealed for Bound<'_, PyDict> {}
32impl Sealed for Bound<'_, PyFloat> {}
33impl Sealed for Bound<'_, PyFrozenSet> {}
34impl Sealed for Bound<'_, PyList> {}
35impl Sealed for Bound<'_, PyMapping> {}
36impl Sealed for Bound<'_, PyMappingProxy> {}
37impl Sealed for Bound<'_, PyModule> {}
38impl Sealed for Bound<'_, PySequence> {}
39impl Sealed for Bound<'_, PySet> {}
40impl Sealed for Bound<'_, PySlice> {}
41impl Sealed for Bound<'_, PyString> {}
42impl Sealed for Bound<'_, PyTraceback> {}
43impl Sealed for Bound<'_, PyTuple> {}
44impl Sealed for Bound<'_, PyType> {}
45impl Sealed for Bound<'_, PyWeakref> {}
46impl Sealed for Bound<'_, PyWeakrefProxy> {}
47impl Sealed for Bound<'_, PyWeakrefReference> {}
48
49impl<T> Sealed for AddTypeToModule<T> {}
50impl<T> Sealed for AddClassToModule<T> {}
51impl Sealed for PyMethodDef {}
52impl Sealed for ModuleDef {}
53
54impl<T: crate::type_object::PyTypeInfo> Sealed for PyNativeTypeInitializer<T> {}
55impl<T: crate::pyclass::PyClass> Sealed for PyClassInitializer<T> {}
56
57impl Sealed for std::sync::Once {}
58impl<T> Sealed for std::sync::Mutex<T> {}
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here