[−][src]Trait pyo3::AsPyRef
Trait implements object reference extraction from python managed pointer.
Required methods
fn as_ref(&self, py: Python) -> PyRef<T>
Return reference to object.
fn as_mut(&mut self, py: Python) -> PyRefMut<T>
Return mutable reference to object.
Provided methods
fn with<F, R>(&self, f: F) -> R where
F: FnOnce(Python, PyRef<T>) -> R,
F: FnOnce(Python, PyRef<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, PyRefMut<T>) -> R,
F: FnOnce(Python, PyRefMut<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, PyRef<T>) -> R,
Self: IntoPyPointer,
F: FnOnce(Python, PyRef<T>) -> R,
fn into_mut_py<F, R>(self, f: F) -> R where
Self: IntoPyPointer,
F: FnOnce(Python, PyRefMut<T>) -> R,
Self: IntoPyPointer,
F: FnOnce(Python, PyRefMut<T>) -> R,
Implementors
impl AsPyRef<PyAny> for PyObject[src]
fn as_ref(&self, _py: Python) -> PyRef<PyAny>[src]
fn as_mut(&mut self, _py: Python) -> PyRefMut<PyAny>[src]
impl<T> AsPyRef<T> for Py<T> where
T: PyTypeInfo, [src]
T: PyTypeInfo,