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