pyo3/impl_/
not_send.rs

1
2
3
4
5
6
7
8
9
10
use std::marker::PhantomData;

use crate::Python;

/// A marker type that makes the type !Send.
/// Workaround for lack of !Send on stable (<https://github.com/rust-lang/rust/issues/68318>).
pub(crate) struct NotSend(PhantomData<*mut Python<'static>>);

#[cfg(feature = "gil-refs")]
pub(crate) const NOT_SEND: NotSend = NotSend(PhantomData);