Trait pyo3::conversion::FromPyObject

source ·
pub trait FromPyObject<'py>: Sized {
    // Required method
    fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>;

    // Provided methods
    fn extract(ob: &'py PyAny) -> PyResult<Self> { ... }
    fn type_input() -> TypeInfo { ... }
}
Expand description

Extract a type from a Python object.

Normal usage is through the extract methods on Bound and Py, which forward to this trait.

§Examples

use pyo3::prelude::*;
use pyo3::types::PyString;

Python::with_gil(|py| {
    // Calling `.extract()` on a `Bound` smart pointer
    let obj: Bound<'_, PyString> = PyString::new_bound(py, "blah");
    let s: String = obj.extract()?;

    // Calling `.extract(py)` on a `Py` smart pointer
    let obj: Py<PyString> = obj.unbind();
    let s: String = obj.extract(py)?;
})

During the migration of PyO3 from the “GIL Refs” API to the Bound<T> smart pointer, this trait has two methods extract and extract_bound which are defaulted to call each other. To avoid infinite recursion, implementors must implement at least one of these methods. The recommendation is to implement extract_bound and leave extract as the default implementation.

Required Methods§

source

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

Extracts Self from the bound smart pointer obj.

Implementors are encouraged to implement this method and leave extract defaulted, as this will be most compatible with PyO3’s future API.

Provided Methods§

source

fn extract(ob: &'py PyAny) -> PyResult<Self>

Available on crate feature gil-refs only.

Extracts Self from the source GIL Ref obj.

Implementors are encouraged to implement extract_bound and leave this method as the default implementation, which will forward calls to extract_bound.

source

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.

Extracts the type hint information for this type when it appears as an argument.

For example, Vec<u32> would return Sequence[int]. The default implementation returns Any, which is correct for any type.

For most types, the return value for this method will be identical to that of IntoPy::type_output. It may be different for some types, such as Dict, to allow duck-typing: functions return Dict but take Mapping as argument.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromPyObject<'_> for IpAddr

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

impl FromPyObject<'_> for Tz

Available on Py_3_9 and crate feature chrono-tz only.
source§

impl FromPyObject<'_> for bool

Converts a Python bool to a Rust bool.

Fails with TypeError if the input is not a Python bool.

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for char

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for i128

Available on non-Py_LIMITED_API and non-GraalPy only.
source§

fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<i128>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for u64

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<u64>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for u128

Available on non-Py_LIMITED_API and non-GraalPy only.
source§

fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<u128>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for usize

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for String

Allows extracting strings from Python objects. Accepts Python str and unicode objects.

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for Duration

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

impl FromPyObject<'_> for OsString

source§

fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Self>

source§

impl FromPyObject<'_> for PathBuf

source§

fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Self>

source§

impl FromPyObject<'_> for SystemTime

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

impl FromPyObject<'_> for NaiveDate

Available on crate feature chrono only.
source§

impl FromPyObject<'_> for NaiveDateTime

Available on crate feature chrono only.
source§

impl FromPyObject<'_> for NaiveTime

Available on crate feature chrono only.
source§

impl FromPyObject<'_> for FixedOffset

Available on crate feature chrono only.
source§

fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<FixedOffset>

Convert python tzinfo to rust FixedOffset.

Note that the conversion will result in precision lost in microseconds as chrono offset does not supports microseconds.

source§

impl FromPyObject<'_> for Utc

Available on crate feature chrono only.
source§

impl FromPyObject<'_> for Complex<f32>

Available on crate feature num-complex only.
source§

impl FromPyObject<'_> for Complex<f64>

Available on crate feature num-complex only.
source§

impl FromPyObject<'_> for Decimal

Available on crate feature rust_decimal only.
source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

impl FromPyObject<'_> for NonZeroI8

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroI16

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroI32

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroI64

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroI128

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroIsize

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroU8

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroU16

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroU32

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroU64

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroU128

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for NonZeroUsize

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for Duration

Available on crate feature chrono only.
source§

impl<'py> FromPyObject<'py> for &'py str

Available on crate feature gil-refs only.

Allows extracting strings from Python objects. Accepts Python str objects.

source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for &'py [u8]

Available on crate feature gil-refs only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for Cow<'py, str>

Available on crate feature gil-refs only.
source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for Cow<'py, [u8]>

Available on crate feature gil-refs only.

Special-purpose trait impl to efficiently handle both bytes and bytearray

If the source object is a bytes object, the Cow will be borrowed and pointing into the source object, and no copying or heap allocations will happen. If it is a bytearray, its contents will be copied to an owned Cow.

source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py> FromPyObject<'py> for f32

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for f64

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for i8

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for i16

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for i32

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for i64

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for isize

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for u8

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for u16

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for u32

source§

fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py> FromPyObject<'py> for BigInt

Available on crate feature num-bigint only.
source§

impl<'py> FromPyObject<'py> for BigUint

Available on crate feature num-bigint only.
source§

impl<'py> FromPyObject<'py> for Ratio<i8>

Available on crate feature num-rational only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py> FromPyObject<'py> for Ratio<i16>

Available on crate feature num-rational only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py> FromPyObject<'py> for Ratio<i32>

Available on crate feature num-rational only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py> FromPyObject<'py> for Ratio<i64>

Available on crate feature num-rational only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py> FromPyObject<'py> for Ratio<isize>

Available on crate feature num-rational only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py> FromPyObject<'py> for Ratio<BigInt>

Available on crate feature num-rational only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py, A> FromPyObject<'py> for SmallVec<A>
where A: Array, A::Item: FromPyObject<'py>,

Available on crate feature smallvec only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, K> FromPyObject<'py> for BTreeSet<K>
where K: FromPyObject<'py> + Ord,

source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, K, S> FromPyObject<'py> for HashSet<K, S>
where K: FromPyObject<'py> + Eq + Hash, S: BuildHasher + Default,

source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, K, S> FromPyObject<'py> for HashSet<K, S>
where K: FromPyObject<'py> + Eq + Hash, S: BuildHasher + Default,

Available on crate feature hashbrown only.
source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py, K, V> FromPyObject<'py> for BTreeMap<K, V>
where K: FromPyObject<'py> + Ord, V: FromPyObject<'py>,

source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> Result<Self, PyErr>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, K, V, S> FromPyObject<'py> for HashMap<K, V, S>
where K: FromPyObject<'py> + Eq + Hash, V: FromPyObject<'py>, S: BuildHasher + Default,

source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> Result<Self, PyErr>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, K, V, S> FromPyObject<'py> for HashMap<K, V, S>
where K: FromPyObject<'py> + Eq + Hash, V: FromPyObject<'py>, S: BuildHasher + Default,

Available on crate feature hashbrown only.
source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> Result<Self, PyErr>

source§

impl<'py, K, V, S> FromPyObject<'py> for IndexMap<K, V, S>
where K: FromPyObject<'py> + Eq + Hash, V: FromPyObject<'py>, S: BuildHasher + Default,

Available on crate feature indexmap only.
source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> Result<Self, PyErr>

source§

impl<'py, L, R> FromPyObject<'py> for Either<L, R>
where L: FromPyObject<'py>, R: FromPyObject<'py>,

Available on crate feature either only.
source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>> FromPyObject<'py> for (T0,)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>> FromPyObject<'py> for (T0, T1)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>, T4: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3, T4)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>, T4: FromPyObject<'py>, T5: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3, T4, T5)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>, T4: FromPyObject<'py>, T5: FromPyObject<'py>, T6: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>, T4: FromPyObject<'py>, T5: FromPyObject<'py>, T6: FromPyObject<'py>, T7: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>, T4: FromPyObject<'py>, T5: FromPyObject<'py>, T6: FromPyObject<'py>, T7: FromPyObject<'py>, T8: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>, T4: FromPyObject<'py>, T5: FromPyObject<'py>, T6: FromPyObject<'py>, T7: FromPyObject<'py>, T8: FromPyObject<'py>, T9: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>, T4: FromPyObject<'py>, T5: FromPyObject<'py>, T6: FromPyObject<'py>, T7: FromPyObject<'py>, T8: FromPyObject<'py>, T9: FromPyObject<'py>, T10: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>, T4: FromPyObject<'py>, T5: FromPyObject<'py>, T6: FromPyObject<'py>, T7: FromPyObject<'py>, T8: FromPyObject<'py>, T9: FromPyObject<'py>, T10: FromPyObject<'py>, T11: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T> FromPyObject<'py> for Option<T>
where T: FromPyObject<'py>,

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py, T> FromPyObject<'py> for Vec<T>
where T: FromPyObject<'py>,

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'py, T, const N: usize> FromPyObject<'py> for [T; N]
where T: FromPyObject<'py>,

source§

fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<'py, T: FromPyObject<'py>> FromPyObject<'py> for Cell<T>

source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

source§

impl<Tz: TimeZone + for<'py> FromPyObject<'py>> FromPyObject<'_> for DateTime<Tz>

Available on crate feature chrono only.

Implementors§

source§

impl FromPyObject<'_> for PyBackedBytes

source§

impl FromPyObject<'_> for PyBackedStr

source§

impl<'py> FromPyObject<'py> for &'py CancelledError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py IncompleteReadError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py InvalidStateError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py LimitOverrunError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py QueueEmpty

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py QueueFull

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py TimeoutError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py gaierror

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py herror

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py timeout

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyArithmeticError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyAssertionError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyAttributeError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyBaseException

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyBlockingIOError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyBrokenPipeError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyBufferError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyBytesWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyChildProcessError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyConnectionAbortedError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyConnectionError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyConnectionRefusedError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyConnectionResetError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyDeprecationWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyEOFError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyEncodingWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyEnvironmentError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyException

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyFileExistsError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyFileNotFoundError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyFloatingPointError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyFutureWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyGeneratorExit

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyIOError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyImportError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyImportWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyIndexError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyInterruptedError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyIsADirectoryError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyKeyError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyKeyboardInterrupt

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyLookupError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyMemoryError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyModuleNotFoundError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyNameError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyNotADirectoryError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyNotImplementedError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyOSError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyOverflowError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyPendingDeprecationWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyPermissionError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyProcessLookupError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyRecursionError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyReferenceError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyResourceWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyRuntimeError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyRuntimeWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyStopAsyncIteration

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyStopIteration

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PySyntaxError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PySyntaxWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PySystemError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PySystemExit

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyTimeoutError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyTypeError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyUnboundLocalError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyUnicodeDecodeError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyUnicodeEncodeError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyUnicodeError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyUnicodeTranslateError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyUnicodeWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyUserWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyValueError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyWarning

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyZeroDivisionError

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PanicException

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyAny

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyBool

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyByteArray

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyBytes

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyCFunction

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyCapsule

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyCode

Available on non-Py_LIMITED_API and non-PyPy and non-GraalPy and crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyComplex

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyDate

Available on non-Py_LIMITED_API and crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyDateTime

Available on non-Py_LIMITED_API and crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyDelta

Available on non-Py_LIMITED_API and crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyDict

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyDictItems

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyDictKeys

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyDictValues

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyEllipsis

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyFloat

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyFrame

Available on non-Py_LIMITED_API and non-PyPy and non-GraalPy and crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyFrozenSet

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyFunction

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyIterator

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyList

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyLong

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyMapping

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyMemoryView

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyModule

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyNone

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyNotImplemented

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PySequence

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PySet

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PySlice

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyString

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PySuper

Available on neither PyPy nor GraalPy and crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyTime

Available on non-Py_LIMITED_API and crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyTraceback

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyTuple

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyType

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyTzInfo

Available on non-Py_LIMITED_API and crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyWeakref

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyWeakrefProxy

Available on crate feature gil-refs only.
source§

impl<'py> FromPyObject<'py> for &'py PyWeakrefReference

Available on crate feature gil-refs only.
source§

impl<'py, T> FromPyObject<'py> for &'py PyCell<T>
where T: PyClass,

Available on crate feature gil-refs only.
source§

impl<'py, T> FromPyObject<'py> for Bound<'py, T>
where T: PyTypeCheck,

source§

impl<'py, T> FromPyObject<'py> for PyRef<'py, T>
where T: PyClass,

source§

impl<'py, T> FromPyObject<'py> for PyRefMut<'py, T>
where T: PyClass<Frozen = False>,

source§

impl<'py, T: Element> FromPyObject<'py> for PyBuffer<T>

Available on non-Py_LIMITED_API or Py_3_11 only.
source§

impl<T> FromPyObject<'_> for Py<T>
where T: PyTypeCheck,

source§

impl<T> FromPyObject<'_> for T
where T: PyClass + Clone,