Trait PyAttributeExtractor

Source
pub trait PyAttributeExtractor {
    // Required methods
    fn extract_attr_with_context(
        &self,
        attr: &str,
        context: &str,
    ) -> PyResult<Bound<'_, PyAny>>;
    fn extract_type_name(&self, context: &str) -> PyResult<String>;
}
Expand description

Trait for extracting Python attributes with consistent error handling.

Required Methods§

Source

fn extract_attr_with_context( &self, attr: &str, context: &str, ) -> PyResult<Bound<'_, PyAny>>

Extract an attribute with context-aware error messages.

Source

fn extract_type_name(&self, context: &str) -> PyResult<String>

Extract a type name with error handling.

Implementations on Foreign Types§

Source§

impl<'py> PyAttributeExtractor for Bound<'py, PyAny>

Source§

fn extract_attr_with_context( &self, attr: &str, context: &str, ) -> PyResult<Bound<'_, PyAny>>

Source§

fn extract_type_name(&self, context: &str) -> PyResult<String>

Implementors§