Trait ExtractFromPython

Source
pub trait ExtractFromPython<'a>: Sized {
    // Required method
    fn extract_with_context(
        ob: &Bound<'a, PyAny>,
        context: &str,
    ) -> PyResult<Self>;
}
Expand description

Trait for types that can be extracted from Python with improved error messages.

Required Methods§

Source

fn extract_with_context(ob: &Bound<'a, PyAny>, context: &str) -> PyResult<Self>

Extract from Python object with context for better error messages.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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