[−][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.
Implementors
impl PyTryFrom for PySequence
[src]
impl PyTryFrom for PySequence
fn try_from(value: &PyObjectRef) -> Result<&PySequence, PyDowncastError>
[src]
fn try_from(value: &PyObjectRef) -> Result<&PySequence, PyDowncastError>
fn try_from_exact(value: &PyObjectRef) -> Result<&PySequence, PyDowncastError>
[src]
fn try_from_exact(value: &PyObjectRef) -> Result<&PySequence, PyDowncastError>
fn try_from_mut(value: &PyObjectRef) -> Result<&mut PySequence, PyDowncastError>
[src]
fn try_from_mut(value: &PyObjectRef) -> Result<&mut PySequence, PyDowncastError>
fn try_from_mut_exact(
value: &PyObjectRef
) -> Result<&mut PySequence, PyDowncastError>
[src]
fn try_from_mut_exact(
value: &PyObjectRef
) -> Result<&mut PySequence, PyDowncastError>
impl<T> PyTryFrom for T where
T: PyTypeInfo,
[src]
impl<T> PyTryFrom for T where
T: PyTypeInfo,
fn try_from(value: &PyObjectRef) -> Result<&T, PyDowncastError>
[src]
fn try_from(value: &PyObjectRef) -> Result<&T, PyDowncastError>
fn try_from_exact(value: &PyObjectRef) -> Result<&T, PyDowncastError>
[src]
fn try_from_exact(value: &PyObjectRef) -> Result<&T, PyDowncastError>
fn try_from_mut(value: &PyObjectRef) -> Result<&mut T, PyDowncastError>
[src]
fn try_from_mut(value: &PyObjectRef) -> Result<&mut T, PyDowncastError>
fn try_from_mut_exact(value: &PyObjectRef) -> Result<&mut T, PyDowncastError>
[src]
fn try_from_mut_exact(value: &PyObjectRef) -> Result<&mut T, PyDowncastError>