pub trait DerefToPyAny { }Expand description
Python objects that have a base type.
This marks types that can be upcast into a PyAny and used in its place.
This essentially includes every Python object except PyAny itself.
This is used to provide the Deref<Target = Bound<'_, PyAny>>
implementations for Bound<'_, T>.
Users should not need to implement this trait directly. It’s implementation
is provided by the #[pyclass] attribute.
§Note
This is needed because the compiler currently tries to figure out all the
types in a deref-chain before starting to look for applicable method calls.
So we need to prevent Bound<'_, PyAny dereferencing to
itself in order to avoid running into the recursion limit. This trait is
used to exclude this from our blanket implementation. See this Rust
issue for more details. If the compiler limitation gets resolved, this
trait will be removed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl DerefToPyAny for CancelledError
impl DerefToPyAny for Coroutine
experimental-async only.impl DerefToPyAny for IncompleteReadError
impl DerefToPyAny for InvalidStateError
impl DerefToPyAny for LimitOverrunError
impl DerefToPyAny for PanicException
impl DerefToPyAny for PyArithmeticError
impl DerefToPyAny for PyAssertionError
impl DerefToPyAny for PyAttributeError
impl DerefToPyAny for PyBaseException
impl DerefToPyAny for PyBaseExceptionGroup
impl DerefToPyAny for PyBlockingIOError
impl DerefToPyAny for PyBool
impl DerefToPyAny for PyBrokenPipeError
impl DerefToPyAny for PyBufferError
impl DerefToPyAny for PyByteArray
impl DerefToPyAny for PyBytes
impl DerefToPyAny for PyBytesWarning
impl DerefToPyAny for PyCFunction
impl DerefToPyAny for PyCapsule
impl DerefToPyAny for PyChildProcessError
impl DerefToPyAny for PyCode
impl DerefToPyAny for PyComplex
impl DerefToPyAny for PyConnectionAbortedError
impl DerefToPyAny for PyConnectionError
impl DerefToPyAny for PyConnectionRefusedError
impl DerefToPyAny for PyConnectionResetError
impl DerefToPyAny for PyDate
impl DerefToPyAny for PyDateTime
impl DerefToPyAny for PyDelta
impl DerefToPyAny for PyDeprecationWarning
impl DerefToPyAny for PyDict
impl DerefToPyAny for PyDictItems
impl DerefToPyAny for PyDictKeys
impl DerefToPyAny for PyDictValues
impl DerefToPyAny for PyEOFError
impl DerefToPyAny for PyEllipsis
impl DerefToPyAny for PyEncodingWarning
impl DerefToPyAny for PyException
impl DerefToPyAny for PyFileExistsError
impl DerefToPyAny for PyFileNotFoundError
impl DerefToPyAny for PyFloat
impl DerefToPyAny for PyFloatingPointError
impl DerefToPyAny for PyFrame
GraalPy and non-Py_LIMITED_API and non-PyPy only.impl DerefToPyAny for PyFrozenSet
impl DerefToPyAny for PyFunction
impl DerefToPyAny for PyFutureWarning
impl DerefToPyAny for PyGeneratorExit
impl DerefToPyAny for PyGenericAlias
Py_3_9 only.