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§
sourcefn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>
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§
sourcefn extract(ob: &'py PyAny) -> PyResult<Self>
Available on crate feature gil-refs
only.
fn extract(ob: &'py PyAny) -> PyResult<Self>
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
.
sourcefn type_input() -> TypeInfo
Available on crate feature experimental-inspect
only.
fn type_input() -> TypeInfo
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§
Implementations on Foreign Types§
source§impl FromPyObject<'_> for IpAddr
impl FromPyObject<'_> for IpAddr
source§impl FromPyObject<'_> for Tz
Available on Py_3_9
and crate feature chrono-tz
only.
impl FromPyObject<'_> for Tz
Py_3_9
and crate feature chrono-tz
only.source§impl FromPyObject<'_> for bool
impl FromPyObject<'_> for bool
Converts a Python bool
to a Rust bool
.
Fails with TypeError
if the input is not a Python bool
.
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for char
impl FromPyObject<'_> for char
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for i128
Available on non-Py_LIMITED_API
and non-GraalPy
only.
impl FromPyObject<'_> for i128
Py_LIMITED_API
and non-GraalPy
only.source§impl FromPyObject<'_> for u64
impl FromPyObject<'_> for u64
source§impl FromPyObject<'_> for u128
Available on non-Py_LIMITED_API
and non-GraalPy
only.
impl FromPyObject<'_> for u128
Py_LIMITED_API
and non-GraalPy
only.source§impl FromPyObject<'_> for usize
impl FromPyObject<'_> for usize
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for String
impl FromPyObject<'_> for String
Allows extracting strings from Python objects.
Accepts Python str
and unicode
objects.
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for Duration
impl FromPyObject<'_> for Duration
source§impl FromPyObject<'_> for OsString
impl FromPyObject<'_> for OsString
source§impl FromPyObject<'_> for PathBuf
impl FromPyObject<'_> for PathBuf
source§impl FromPyObject<'_> for SystemTime
impl FromPyObject<'_> for SystemTime
source§impl FromPyObject<'_> for NaiveDate
Available on crate feature chrono
only.
impl FromPyObject<'_> for NaiveDate
chrono
only.source§impl FromPyObject<'_> for NaiveDateTime
Available on crate feature chrono
only.
impl FromPyObject<'_> for NaiveDateTime
chrono
only.fn extract_bound(dt: &Bound<'_, PyAny>) -> PyResult<NaiveDateTime>
source§impl FromPyObject<'_> for NaiveTime
Available on crate feature chrono
only.
impl FromPyObject<'_> for NaiveTime
chrono
only.source§impl FromPyObject<'_> for FixedOffset
Available on crate feature chrono
only.
impl FromPyObject<'_> for FixedOffset
chrono
only.source§fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<FixedOffset>
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.
impl FromPyObject<'_> for Utc
chrono
only.source§impl FromPyObject<'_> for Complex<f32>
Available on crate feature num-complex
only.
impl FromPyObject<'_> for Complex<f32>
num-complex
only.source§impl FromPyObject<'_> for Complex<f64>
Available on crate feature num-complex
only.
impl FromPyObject<'_> for Complex<f64>
num-complex
only.source§impl FromPyObject<'_> for Decimal
Available on crate feature rust_decimal
only.
impl FromPyObject<'_> for Decimal
rust_decimal
only.source§impl FromPyObject<'_> for NonZeroI8
impl FromPyObject<'_> for NonZeroI8
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroI16
impl FromPyObject<'_> for NonZeroI16
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroI32
impl FromPyObject<'_> for NonZeroI32
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroI64
impl FromPyObject<'_> for NonZeroI64
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroI128
impl FromPyObject<'_> for NonZeroI128
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroIsize
impl FromPyObject<'_> for NonZeroIsize
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroU8
impl FromPyObject<'_> for NonZeroU8
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroU16
impl FromPyObject<'_> for NonZeroU16
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroU32
impl FromPyObject<'_> for NonZeroU32
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroU64
impl FromPyObject<'_> for NonZeroU64
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroU128
impl FromPyObject<'_> for NonZeroU128
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for NonZeroUsize
impl FromPyObject<'_> for NonZeroUsize
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl FromPyObject<'_> for Duration
Available on crate feature chrono
only.
impl FromPyObject<'_> for Duration
chrono
only.source§impl<'py> FromPyObject<'py> for &'py str
Available on crate feature gil-refs
only.
impl<'py> FromPyObject<'py> for &'py str
gil-refs
only.Allows extracting strings from Python objects.
Accepts Python str
objects.
fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for &'py [u8]
Available on crate feature gil-refs
only.
impl<'py> FromPyObject<'py> for &'py [u8]
gil-refs
only.fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for Cow<'py, str>
Available on crate feature gil-refs
only.
impl<'py> FromPyObject<'py> for Cow<'py, str>
gil-refs
only.fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for Cow<'py, [u8]>
Available on crate feature gil-refs
only.
impl<'py> FromPyObject<'py> for Cow<'py, [u8]>
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§impl<'py> FromPyObject<'py> for f32
impl<'py> FromPyObject<'py> for f32
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for f64
impl<'py> FromPyObject<'py> for f64
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for i8
impl<'py> FromPyObject<'py> for i8
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for i16
impl<'py> FromPyObject<'py> for i16
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for i32
impl<'py> FromPyObject<'py> for i32
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for i64
impl<'py> FromPyObject<'py> for i64
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for isize
impl<'py> FromPyObject<'py> for isize
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for u8
impl<'py> FromPyObject<'py> for u8
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for u16
impl<'py> FromPyObject<'py> for u16
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for u32
impl<'py> FromPyObject<'py> for u32
fn extract_bound(obj: &Bound<'_, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py> FromPyObject<'py> for BigInt
Available on crate feature num-bigint
only.
impl<'py> FromPyObject<'py> for BigInt
num-bigint
only.source§impl<'py> FromPyObject<'py> for BigUint
Available on crate feature num-bigint
only.
impl<'py> FromPyObject<'py> for BigUint
num-bigint
only.source§impl<'py> FromPyObject<'py> for Ratio<i8>
Available on crate feature num-rational
only.
impl<'py> FromPyObject<'py> for Ratio<i8>
num-rational
only.source§impl<'py> FromPyObject<'py> for Ratio<i16>
Available on crate feature num-rational
only.
impl<'py> FromPyObject<'py> for Ratio<i16>
num-rational
only.source§impl<'py> FromPyObject<'py> for Ratio<i32>
Available on crate feature num-rational
only.
impl<'py> FromPyObject<'py> for Ratio<i32>
num-rational
only.source§impl<'py> FromPyObject<'py> for Ratio<i64>
Available on crate feature num-rational
only.
impl<'py> FromPyObject<'py> for Ratio<i64>
num-rational
only.source§impl<'py> FromPyObject<'py> for Ratio<isize>
Available on crate feature num-rational
only.
impl<'py> FromPyObject<'py> for Ratio<isize>
num-rational
only.source§impl<'py> FromPyObject<'py> for Ratio<BigInt>
Available on crate feature num-rational
only.
impl<'py> FromPyObject<'py> for Ratio<BigInt>
num-rational
only.source§impl<'py, A> FromPyObject<'py> for SmallVec<A>
Available on crate feature smallvec
only.
impl<'py, A> FromPyObject<'py> for SmallVec<A>
smallvec
only.fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py, K> FromPyObject<'py> for BTreeSet<K>where
K: FromPyObject<'py> + Ord,
impl<'py, K> FromPyObject<'py> for BTreeSet<K>where
K: FromPyObject<'py> + Ord,
fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py, K, S> FromPyObject<'py> for HashSet<K, S>
impl<'py, K, S> FromPyObject<'py> for HashSet<K, S>
fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py, K, S> FromPyObject<'py> for HashSet<K, S>
Available on crate feature hashbrown
only.
impl<'py, K, S> FromPyObject<'py> for HashSet<K, S>
hashbrown
only.source§impl<'py, K, V> FromPyObject<'py> for BTreeMap<K, V>
impl<'py, K, V> FromPyObject<'py> for BTreeMap<K, V>
source§impl<'py, K, V, S> FromPyObject<'py> for HashMap<K, V, S>
impl<'py, K, V, S> FromPyObject<'py> for HashMap<K, V, S>
source§impl<'py, K, V, S> FromPyObject<'py> for HashMap<K, V, S>
Available on crate feature hashbrown
only.
impl<'py, K, V, S> FromPyObject<'py> for HashMap<K, V, S>
hashbrown
only.source§impl<'py, K, V, S> FromPyObject<'py> for IndexMap<K, V, S>
Available on crate feature indexmap
only.
impl<'py, K, V, S> FromPyObject<'py> for IndexMap<K, V, S>
indexmap
only.source§impl<'py, L, R> FromPyObject<'py> for Either<L, R>where
L: FromPyObject<'py>,
R: FromPyObject<'py>,
Available on crate feature either
only.
impl<'py, L, R> FromPyObject<'py> for Either<L, R>where
L: FromPyObject<'py>,
R: FromPyObject<'py>,
either
only.fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py, T0: FromPyObject<'py>> FromPyObject<'py> for (T0,)
impl<'py, T0: FromPyObject<'py>> FromPyObject<'py> for (T0,)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>> FromPyObject<'py> for (T0, T1)
impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>> FromPyObject<'py> for (T0, T1)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2)
impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
impl<'py, T0: FromPyObject<'py>, T1: FromPyObject<'py>, T2: FromPyObject<'py>, T3: FromPyObject<'py>> FromPyObject<'py> for (T0, T1, T2, T3)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
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)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
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)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
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)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
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)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
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)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
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)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
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)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
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)
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)
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py, T> FromPyObject<'py> for Option<T>where
T: FromPyObject<'py>,
impl<'py, T> FromPyObject<'py> for Option<T>where
T: FromPyObject<'py>,
source§impl<'py, T> FromPyObject<'py> for Vec<T>where
T: FromPyObject<'py>,
impl<'py, T> FromPyObject<'py> for Vec<T>where
T: FromPyObject<'py>,
fn extract_bound(obj: &Bound<'py, PyAny>) -> PyResult<Self>
source§fn type_input() -> TypeInfo
fn type_input() -> TypeInfo
experimental-inspect
only.source§impl<'py, T, const N: usize> FromPyObject<'py> for [T; N]where
T: FromPyObject<'py>,
impl<'py, T, const N: usize> FromPyObject<'py> for [T; N]where
T: FromPyObject<'py>,
source§impl<'py, T: FromPyObject<'py>> FromPyObject<'py> for Cell<T>
impl<'py, T: FromPyObject<'py>> FromPyObject<'py> for Cell<T>
source§impl<Tz: TimeZone + for<'py> FromPyObject<'py>> FromPyObject<'_> for DateTime<Tz>
Available on crate feature chrono
only.
impl<Tz: TimeZone + for<'py> FromPyObject<'py>> FromPyObject<'_> for DateTime<Tz>
chrono
only.Implementors§
impl FromPyObject<'_> for PyBackedBytes
impl FromPyObject<'_> for PyBackedStr
impl<'py> FromPyObject<'py> for &'py CancelledError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py IncompleteReadError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py InvalidStateError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py LimitOverrunError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py QueueEmpty
gil-refs
only.impl<'py> FromPyObject<'py> for &'py QueueFull
gil-refs
only.impl<'py> FromPyObject<'py> for &'py TimeoutError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py gaierror
gil-refs
only.impl<'py> FromPyObject<'py> for &'py herror
gil-refs
only.impl<'py> FromPyObject<'py> for &'py timeout
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyArithmeticError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyAssertionError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyAttributeError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyBaseException
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyBlockingIOError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyBrokenPipeError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyBufferError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyBytesWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyChildProcessError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyConnectionAbortedError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyConnectionError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyConnectionRefusedError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyConnectionResetError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyDeprecationWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyEOFError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyEncodingWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyEnvironmentError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyException
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyFileExistsError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyFileNotFoundError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyFloatingPointError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyFutureWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyGeneratorExit
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyIOError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyImportError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyImportWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyIndexError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyInterruptedError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyIsADirectoryError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyKeyError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyKeyboardInterrupt
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyLookupError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyMemoryError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyModuleNotFoundError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyNameError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyNotADirectoryError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyNotImplementedError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyOSError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyOverflowError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyPendingDeprecationWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyPermissionError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyProcessLookupError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyRecursionError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyReferenceError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyResourceWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyRuntimeError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyRuntimeWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyStopAsyncIteration
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyStopIteration
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PySyntaxError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PySyntaxWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PySystemError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PySystemExit
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyTimeoutError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyTypeError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyUnboundLocalError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyUnicodeDecodeError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyUnicodeEncodeError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyUnicodeError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyUnicodeTranslateError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyUnicodeWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyUserWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyValueError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyWarning
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyZeroDivisionError
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PanicException
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyAny
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyBool
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyByteArray
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyBytes
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyCFunction
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyCapsule
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyCode
Py_LIMITED_API
and non-PyPy
and non-GraalPy
and crate feature gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyComplex
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyDate
Py_LIMITED_API
and crate feature gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyDateTime
Py_LIMITED_API
and crate feature gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyDelta
Py_LIMITED_API
and crate feature gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyDict
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyDictItems
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyDictKeys
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyDictValues
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyEllipsis
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyFloat
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyFrame
Py_LIMITED_API
and non-PyPy
and non-GraalPy
and crate feature gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyFrozenSet
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyFunction
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyIterator
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyList
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyLong
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyMapping
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyMemoryView
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyModule
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyNone
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyNotImplemented
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PySequence
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PySet
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PySlice
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyString
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PySuper
PyPy
nor GraalPy
and crate feature gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyTime
Py_LIMITED_API
and crate feature gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyTraceback
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyTuple
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyType
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyTzInfo
Py_LIMITED_API
and crate feature gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyWeakref
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyWeakrefProxy
gil-refs
only.impl<'py> FromPyObject<'py> for &'py PyWeakrefReference
gil-refs
only.impl<'py, T> FromPyObject<'py> for &'py PyCell<T>where
T: PyClass,
gil-refs
only.impl<'py, T> FromPyObject<'py> for Bound<'py, T>where
T: PyTypeCheck,
impl<'py, T> FromPyObject<'py> for PyRef<'py, T>where
T: PyClass,
impl<'py, T> FromPyObject<'py> for PyRefMut<'py, T>where
T: PyClass<Frozen = False>,
impl<'py, T: Element> FromPyObject<'py> for PyBuffer<T>
Py_LIMITED_API
or Py_3_11
only.