[−][src]Trait pyo3::PyTryFrom
Trait implemented by Python object types that allow a checked downcast.
This trait is similar to std::convert::TryFrom
Required methods
fn try_from(value: &PyObjectRef) -> Result<&Self, PyDowncastError>
Cast from a concrete Python object type to PyObject.
fn try_from_exact(value: &PyObjectRef) -> Result<&Self, PyDowncastError>
Cast from a concrete Python object type to PyObject. With exact type check.
fn try_from_mut(value: &PyObjectRef) -> Result<&mut Self, PyDowncastError>
Cast from a concrete Python object type to PyObject.
fn try_from_mut_exact(value: &PyObjectRef) -> Result<&mut Self, PyDowncastError>
Cast from a concrete Python object type to PyObject. With exact type check.
unsafe fn try_from_unchecked(value: &PyObjectRef) -> &Self
Cast a PyObjectRef to a specific type of PyObject. The caller must have already verified the reference is for this type.
unsafe fn try_from_mut_unchecked(value: &PyObjectRef) -> &mut Self
Cast a PyObjectRef to a specific type of PyObject. The caller must have already verified the reference is for this type.
Implementors
impl PyTryFrom for PySequence
[src]
fn try_from(value: &PyObjectRef) -> Result<&PySequence, PyDowncastError>
[src]
fn try_from_exact(value: &PyObjectRef) -> Result<&PySequence, PyDowncastError>
[src]
fn try_from_mut(value: &PyObjectRef) -> Result<&mut PySequence, PyDowncastError>
[src]
fn try_from_mut_exact(
value: &PyObjectRef
) -> Result<&mut PySequence, PyDowncastError>
[src]
value: &PyObjectRef
) -> Result<&mut PySequence, PyDowncastError>
unsafe fn try_from_unchecked(value: &PyObjectRef) -> &PySequence
[src]
unsafe fn try_from_mut_unchecked(value: &PyObjectRef) -> &mut PySequence
[src]
impl<T> PyTryFrom for T where
T: PyTypeInfo,
[src]
T: PyTypeInfo,