pub trait FromPyObject<'source>: Sized {
    // Required method
    fn extract(ob: &'source PyAny) -> PyResult<Self>;

    // Provided method
    fn type_input() -> TypeInfo { ... }
}
Expand description

Extract a type from a Python object.

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

§Examples

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

Python::with_gil(|py| {
    let obj: Py<PyString> = PyString::new(py, "blah").into();

    // Straight from an owned reference
    let s: &str = obj.extract(py)?;

    // Or from a borrowed reference
    let obj: &PyString = obj.as_ref(py);
    let s: &str = obj.extract()?;
})

Note: depending on the implementation, the lifetime of the extracted result may depend on the lifetime of the obj or the prepared variable.

For example, when extracting &str from a Python byte string, the resulting string slice will point to the existing string data (lifetime: 'source). On the other hand, when extracting &str from a Python Unicode string, the preparation step will convert the string to UTF-8, and the resulting string slice will have lifetime 'prepared. Since which case applies depends on the runtime type of the Python object, both the obj and prepared variables must outlive the resulting string slice.

The trait’s conversion method takes a &PyAny argument but is called FromPyObject for historical reasons.

Required Methods§

source

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

Extracts Self from the source PyObject.

Provided Methods§

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(obj: &PyAny) -> PyResult<Self>

source§

impl FromPyObject<'_> for char

source§

fn extract(obj: &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(obj: &PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl FromPyObject<'_> for OsString

source§

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

source§

impl FromPyObject<'_> for PathBuf

source§

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

source§

impl FromPyObject<'_> for DateTime<FixedOffset>

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

impl FromPyObject<'_> for DateTime<Utc>

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

impl FromPyObject<'_> for NaiveDate

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

impl FromPyObject<'_> for NaiveDateTime

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

impl FromPyObject<'_> for NaiveTime

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

impl FromPyObject<'_> for FixedOffset

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

fn extract(ob: &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 and non-Py_LIMITED_API only.
source§

impl FromPyObject<'_> for Decimal

Available on crate feature rust_decimal only.
source§

fn extract(obj: &PyAny) -> PyResult<Self>

source§

impl FromPyObject<'_> for Duration

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

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

source§

fn extract(obj: &'a PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

Available on crate feature smallvec only.
source§

fn extract(obj: &'a PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'a PyAny) -> PyResult<Self>

source§

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

source§

fn extract(obj: &'a PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'a PyAny) -> PyResult<Self>

source§

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

source§

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

source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(obj: &'s PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

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

source§

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

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

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(ob: &'source PyAny) -> PyResult<Self>

source§

impl<'source> FromPyObject<'source> for bool

Converts a Python bool to a Rust bool.

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

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for f32

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for f64

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for i8

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for i16

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for i32

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for i64

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for i128

Available on non-Py_LIMITED_API only.
source§

fn extract(ob: &'source PyAny) -> PyResult<i128>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for isize

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for u8

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for u16

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for u32

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for u64

source§

fn extract(ob: &'source PyAny) -> PyResult<u64>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for u128

Available on non-Py_LIMITED_API only.
source§

fn extract(ob: &'source PyAny) -> PyResult<u128>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for usize

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for BigInt

Available on crate feature num-bigint only.
source§

fn extract(ob: &'source PyAny) -> PyResult<BigInt>

source§

impl<'source> FromPyObject<'source> for BigUint

Available on crate feature num-bigint only.
source§

fn extract(ob: &'source PyAny) -> PyResult<BigUint>

source§

impl<'source> FromPyObject<'source> for Complex<f32>

Available on crate feature num-complex only.
source§

fn extract(obj: &'source PyAny) -> PyResult<Complex<f32>>

source§

impl<'source> FromPyObject<'source> for Complex<f64>

Available on crate feature num-complex only.
source§

fn extract(obj: &'source PyAny) -> PyResult<Complex<f64>>

source§

impl<'source> FromPyObject<'source> for NonZeroI8

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroI16

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroI32

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroI64

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroI128

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroIsize

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroU8

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroU16

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroU32

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroU64

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroU128

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

impl<'source> FromPyObject<'source> for NonZeroUsize

source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

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

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

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

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

Available on crate feature hashbrown only.
source§

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

source§

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

source§

fn extract(ob: &'source PyAny) -> Result<Self, PyErr>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

source§

fn extract(ob: &'source PyAny) -> Result<Self, PyErr>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.
source§

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

Available on crate feature hashbrown only.
source§

fn extract(ob: &'source PyAny) -> Result<Self, PyErr>

source§

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

Available on crate feature indexmap only.
source§

fn extract(ob: &'source PyAny) -> Result<Self, PyErr>

source§

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

Available on crate feature either only.
source§

fn extract(obj: &'source PyAny) -> PyResult<Self>

source§

fn type_input() -> TypeInfo

Available on crate feature experimental-inspect only.

Implementors§

source§

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

source§

impl<'a, T> FromPyObject<'a> for Py<T>
where T: PyTypeInfo, &'a T::AsRefTarget: FromPyObject<'a>, T::AsRefTarget: 'a + AsPyPointer,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

Available on non-Py_LIMITED_API only.
source§

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

source§

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

Available on non-Py_LIMITED_API only.
source§

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

Available on non-Py_LIMITED_API only.
source§

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

Available on non-Py_LIMITED_API only.
source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

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

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

Available on non-PyPy only.
source§

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

Available on non-Py_LIMITED_API only.
source§

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

source§

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

source§

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

source§

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

Available on non-Py_LIMITED_API only.
source§

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

Available on non-Py_LIMITED_API or Py_3_11 only.