Trait pyo3::AsPyRef[][src]

pub trait AsPyRef<T>: Sized {
    fn as_ref(&self, py: Python) -> &T;
fn as_mut(&self, py: Python) -> &mut T; fn with<F, R>(&self, f: F) -> R
    where
        F: FnOnce(Python, &T) -> R
, { ... }
fn with_mut<F, R>(&self, f: F) -> R
    where
        F: FnOnce(Python, &mut T) -> R
, { ... }
fn into_py<F, R>(self, f: F) -> R
    where
        Self: IntoPyPointer,
        F: FnOnce(Python, &T) -> R
, { ... }
fn into_mut_py<F, R>(self, f: F) -> R
    where
        Self: IntoPyPointer,
        F: FnOnce(Python, &mut T) -> R
, { ... } }

Trait implements object reference extraction from python managed pointer.

Required Methods

Return reference to object.

Return mutable reference to object.

Provided Methods

Acquire python gil and call closure with object reference.

Acquire python gil and call closure with mutable object reference.

Implementors