[][src]Trait pyo3::PyTryInto

pub trait PyTryInto<T>: Sized {
    type Error;
    fn try_into(&self) -> Result<&T, Self::Error>;
fn try_into_exact(&self) -> Result<&T, Self::Error>;
fn try_into_mut(&self) -> Result<&mut T, Self::Error>;
fn try_into_mut_exact(&self) -> Result<&mut T, Self::Error>; }

Trait implemented by Python object types that allow a checked downcast. This trait is similar to std::convert::TryInto

Associated Types

type Error

The type returned in the event of a conversion error.

Loading content...

Required methods

fn try_into(&self) -> Result<&T, Self::Error>

Cast from PyObject to a concrete Python object type.

fn try_into_exact(&self) -> Result<&T, Self::Error>

Cast from PyObject to a concrete Python object type. With exact type check.

fn try_into_mut(&self) -> Result<&mut T, Self::Error>

Cast from PyObject to a concrete Python object type.

fn try_into_mut_exact(&self) -> Result<&mut T, Self::Error>

Cast from PyObject to a concrete Python object type. With exact type check.

Loading content...

Implementors

Loading content...