[][src]Trait pyo3::AsPyRef

pub trait AsPyRef<T>: Sized {
    fn as_ref(&self, py: Python) -> &T;
fn as_mut(&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>(&mut 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

fn as_ref(&self, py: Python) -> &T

Return reference to object.

fn as_mut(&mut self, py: Python) -> &mut T

Return mutable reference to object.

Loading content...

Provided methods

fn with<F, R>(&self, f: F) -> R where
    F: FnOnce(Python, &T) -> R, 

Acquire python gil and call closure with object reference.

fn with_mut<F, R>(&mut self, f: F) -> R where
    F: FnOnce(Python, &mut T) -> R, 

Acquire python gil and call closure with mutable object reference.

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, 

Loading content...

Implementors

impl AsPyRef<PyObjectRef> for PyObject[src]

fn with<F, R>(&self, f: F) -> R where
    F: FnOnce(Python, &T) -> R, 
[src]

fn with_mut<F, R>(&mut self, f: F) -> R where
    F: FnOnce(Python, &mut T) -> R, 
[src]

fn into_py<F, R>(self, f: F) -> R where
    Self: IntoPyPointer,
    F: FnOnce(Python, &T) -> R, 
[src]

fn into_mut_py<F, R>(self, f: F) -> R where
    Self: IntoPyPointer,
    F: FnOnce(Python, &mut T) -> R, 
[src]

impl<T> AsPyRef<T> for Py<T> where
    T: PyTypeInfo
[src]

fn with<F, R>(&self, f: F) -> R where
    F: FnOnce(Python, &T) -> R, 
[src]

fn with_mut<F, R>(&mut self, f: F) -> R where
    F: FnOnce(Python, &mut T) -> R, 
[src]

fn into_py<F, R>(self, f: F) -> R where
    Self: IntoPyPointer,
    F: FnOnce(Python, &T) -> R, 
[src]

fn into_mut_py<F, R>(self, f: F) -> R where
    Self: IntoPyPointer,
    F: FnOnce(Python, &mut T) -> R, 
[src]

Loading content...