[−][src]Trait pyo3::pyclass::PyClassSend
This trait is implemented for #[pyclass]
and handles following two situations:
- In case
T
isSend
, stubThreadChecker
is used and does nothing. This implementation is used by default. Compile fails ifT: !Send
. - In case
T
is!Send
,ThreadChecker
panics whenT
is accessed by another thread. This implementation is used when#[pyclass(unsendable)]
is given. Panicking makes it safe to exposeT: !Send
to the Python interpreter, where all objects can be accessed by multiple threads bythreading
module.