Skip to main content

PyMutexTrait

Trait PyMutexTrait 

Source
pub trait PyMutexTrait<'a, T: ?Sized + 'a>: Sealed<'a, T> {
    // Required methods
#[doc(hidden)]
unsafe fn data(&'a self) -> &'a UnsafeCell<T>;
#[doc(hidden)]
unsafe fn inner(&'a self) -> &'a UnsafeCell<PyMutex>; }
Available on Py_3_13 and non-Py_LIMITED_API only.
Expand description

Trait for mutex types used in critical_section API.

Implemented by:

Required Methods§

Source

#[doc(hidden)]
unsafe fn data(&'a self) -> &'a UnsafeCell<T>

§Safety

This function may not be called from outside of PyO3

Source

#[doc(hidden)]
unsafe fn inner(&'a self) -> &'a UnsafeCell<PyMutex>

§Safety

This function may not be called from outside of PyO3

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, T, U, D> PyMutexTrait<'a, T> for D
where T: ?Sized + 'a, U: ?Sized + PyMutexTrait<'a, T> + 'a, D: ?Sized + Deref<Target = U>,

Source§

impl<'a, T: ?Sized + 'a> PyMutexTrait<'a, T> for pyo3::sync::mutex::PyMutex<T>

Available on wip_feature_std only.
Source§

impl<'a, T: ?Sized + 'a> PyMutexTrait<'a, T> for pyo3::sync::nonpoison::PyMutex<T>

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here